[PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default

Bill Spitzak spitzak at gmail.com
Mon May 25 12:17:43 PDT 2015


It can use wayland-0 if $DISPLAY is not set. So the rules programs that 
can use both Wayland and X11 but prefer Wayland could be:

  Use $WAYLAND_DISPLAY if set
  Use $DISPLAY if set
  Use wayland-0

On 05/25/2015 01:12 AM, Dima Ryazanov wrote:
> Although defaulting to wayland-0 seems convenient, it has an undesirable
> side effect: clients may unintentionally connect to the wrong compositor.
> Generally, it's safer to fail instead. Here's a real example:
>
> In Fedora 22, Gtk+ prefers Wayland over X11, though the default session is still
> a normal X11 Gnome session. When you launch a Gtk+ app, it will try Wayland,
> fail, then try X11, and succesfully start up. That works fine.
>
> Now suppose you launch Weston while running the Gnome session. Suddenly, all
> of the Gtk+ apps launched from Gnome will show up inside Weston instead.
> That's unexpected. There's also no good way to prevent that from happening
> (other than perhaps setting WAYLAND_DISPLAY to an invalid value when launching
> an app).
>
> Not using wayland-0 as the default will solve that problem: an app launched
> from the X11 Gnome session will use the X11 backend regardless of whether
> there's a wayland compositor running at the same time.



More information about the wayland-devel mailing list