Not long ago I decided to switch Wayland back off on my system, which I did by removing USE=wayland from make.conf and running emerge --newuse @world. However, a recent attempt to emerge net-misc/vinagre (which depends on net-libs/gtk-vnc) has failed with: /usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64/libgtk-vnc-2.0.so: undefined reference to `gdk_wayland_display_get_type' collect2: error: ld returned 1 exit status Reemerging net-libs/gtk-vnc on a Wayland-free system has made the problem go away.
That's just automagic stuff from gtk+[wayland]. Having to lock these is not nice to the common user who doesn't flip these things. It could use a subslot operator dep kind of thing, but for USE flags. "Rebuild this package if the USE flag toggle on package X changes", or something close to that.
Bug 624960 is the bigger bug about this. Not sure if to DUP against it or not. Should look into gtk-vnc, in case it has some other wayland specifics, which might be the case with such a library; then if it has a USE flag anyways, we can lock it with gtk+ somewhat maybe in this specific case..
I did the same thing a couple of months ago and this time gtk-vnc lost its Wayland-related symbols without a manual rebuild.