How can an X11 tell it's running in XWayland?

Jonas Ã…dahl jadahl at
Fri Jul 31 00:52:32 PDT 2015

On Fri, Jul 31, 2015 at 09:48:53AM +0200, Olivier Fourdan wrote:
> Hi
> Some apps should be run in a plain X11 session but not in XWayland (e.g. an
> X11 screensaver makes no sense in Wayland/XWayland).
> There is one atom WL_SURFACE_ID that should be created only on/by XWayland
> (for obvious reasons), is that reliable enough to determine we're running
> on XWayland?

Might be missing something obvious but shouldn't it be possible to check
whether WAYLAND_DISPLAY environment variable is set?


> Thanks,
> Olivier

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at

More information about the wayland-devel mailing list