Basically AFAICS there are packages where 'wayland' means 'enable wayland support' and there are packages where 'wayland' means 'support only wayland, and fail hard on X11'. I've also noticed similar problems with gles flags in the past. I think it'd be nice to have some brainstorm on how to improve this. Maybe we should have separate flags or some other way to clearly indicate which one it is at least.
I would say those using USE=wayland to mean "use wayland and not work with X11 at all" are wrong here, when there is no USE=X alongside to support X11 too. But I'm not sure how to handle the packages that fail to support both (unless they are wayland compositors or the like). Do we have an initial list of packages where USE=wayland makes it not work on X11 to have a better idea?
media-libs/glfw is the one I've noticed it. Any game using it fails to start when built with USE=wayland. I suppose a good trick to find them would be look for RDEPENDs with '!wayland?'. This yields: gnome-base/gnome-control-center wayland? ( dev-libs/libinput ) !wayland? ( >=x11-drivers/xf86-input-libinput-0.19.0 input_devices_wacom? ( >=x11-drivers/xf86-input-wacom-0.33.0 ) ) media-libs/glfw !wayland? ( virtual/opengl x11-libs/libX11 x11-libs/libXcursor x11-libs/libXinerama x11-libs/libXrandr x11-libs/libXxf86vm ) wayland? ( dev-libs/wayland media-libs/mesa[egl,wayland] )
And yeah, I suppose having explicit REQUIRED_USE="^^ ( wayland X )" would be a better way to clearly indicate 'you can't have both, sorry'.
gnome-control-center is sort of fine here - it will work with either, just with X it also pulls in the needed X11 input drivers (one of which in turn pulls in libinput too anyways). I suppose we should really do the !wayland part with a X? instead, however.. I'm not sure about REQUIRED_USE so much, ideally glfw could work with either in the same build. Maybe its maintainers have an idea why it doesn't, or maybe it does and the packaging just is as such. In this conversation please keep in mind that we are likely to enable USE=wayland alongside USE=X by default in GNOME profiles, likely before the year is over.
Adding glfw and gnome-control-center maintainers to CC for their input
GLES issue split into bug #627758.
Perhaps something like the python_{target,single}: display_single_x11 display_target_wayland display_target_x11 I did understand that python semantics at once.
PYTHON_SINGLE_TARGET is a cheap hack that was needed because we couldn't get a single defaults for all packages. It will eventually be removed when we can rely on GLEP 73 in all packages.