wl_display_connect() falling back to wayland-0

Emilio Pozuelo Monfort pochu27 at gmail.com
Mon Dec 9 04:38:57 PST 2013


I was looking at making gtk+ try the wayland backend before the x11 one [1].
This would solve the problem where every gtk+ app uses the x11 backend through
XWayland when the latter is available.

As you can read on comment #3 and in the patch from comment #1,
wl_display_connect() currently falls back to wayland-0 if WAYLAND_DISPLAY is not
in the environment, which causes the wayland backend initialization to succeed
when running from X11 while weston is running (whether in a different tty or in
an X11 window).

The workaround I'm using in gtk+ is to directly fail the wayland backend
initialization if WAYLAND_DISPLAY is not set, as Pekka suggested to me. This
works nicely, making gtk+ apps use the x11 backend when launched from within
X11, and use the wayland backend when started within weston.

So my question is: why are we falling back to wayland-0 when WAYLAND_DISPLAY
isn't set? Is this so that one can easily/quickly run apps from a tty for
debugging purposes?


[1] https://bugzilla.gnome.org/show_bug.cgi?id=719989

More information about the wayland-devel mailing list