Skip to content
Commit fb7e1302 authored by Dima Ryazanov's avatar Dima Ryazanov Committed by Pekka Paalanen
Browse files

client: require WAYLAND_DISPLAY to be set



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.

Signed-off-by: default avatarDima Ryazanov <dima@gmail.com>
Acked-by: default avatarPekka Paalanen <ppaalanen@gmail.com>
Acked-by: default avatarGiulio Camuffo <giuliocamuffo@gmail.com>
Acked-by: default avatarDaniel Stone <daniel@fooishbar.org>
Acked-by: default avatarJasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: default avatarRyo Munakata <ryomnktml@gmail.com>

[Pekka: dropped the wayland-server.c hunk, adjusted summary]

Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent 441f9bb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment