yarp: fix build against gtkmm

Closes #19599.