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

Giulio Camuffo giuliocamuffo at gmail.com
Tue May 26 02:26:09 PDT 2015


2015-05-26 12:21 GMT+03:00 Pekka Paalanen <ppaalanen at gmail.com>:
> On Mon, 25 May 2015 01:12:15 -0700
> Dima Ryazanov <dima at gmail.com> 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.
>>
>> Everything else should work as before. The compositor already sets
>> the WAYLAND_DISPLAY when starting the session, so the lack of the default value
>> should not make a difference to the user.
>
> Hi,
>
> I have a vague recollection this has been proposed before, but I can't
> remember if there was any interest or discussion, nor what was the
> original intent behind defaulting to "wayland-0".
>
> Personally I'd be fine with this change, but I can't imagine what would
> break if we did this.

I think it is quite safe. All compositors need to export
WAYLAND_DISPLAY anyway in case they use a different socket that
wayland-0. What we could break is users starting apps, say, from a
tty, but i think that's acceptable if we put a big warning in the
release notes. It's not like they need to patch software to fix it.

--
Giulio

>
> Need more opinions.
>
>
> Thanks,
> pq
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list