mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
Revert "client: require WAYLAND_DISPLAY to be set"
This reverts commit fb7e130217.
Developers have been trying to reduce the number of by default required
environment variables, and the mentioned commit is a step backwards in
that sense. The fundamental assumption is that a user has only one main
(Wayland) display server where all programs should connect to by
default, and do so with an a priori known socket name.
The commit also broke various use cases in the wild, some accidentally
due to other causes, some intentionally. This revert allows those use
cases to continue.
The original problem of running Weston in a window in an existing GNOME
X11 session and getting applications unintentionally launched into
Weston can be circumvented by letting Weston use a non-default socket
name, leaving wayland-0 unused.
Discussion:
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023927.html
http://lists.freedesktop.org/archives/wayland-devel/2015-August/023937.html
Cc: Dima Ryazanov <dima@gmail.com>
Cc: Giulio Camuffo <giuliocamuffo@gmail.com>
Cc: Daniel Stone <daniel@fooishbar.org>
Cc: Jasper St. Pierre <jstpierre@mecheye.net>
Cc: Ryo Munakata <ryomnktml@gmail.com>
Cc: Ray Strode <halfline@gmail.com>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Cc: Matthias Clasen <mclasen@redhat.com>
Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Ray Strode <rstrode@redhat.com>
Acked-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-By: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-By: Ryo Munakata <ryomnktml@gmail.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c0636ddcac
commit
c7dbaa1cfd
3 changed files with 11 additions and 12 deletions
|
|
@ -764,11 +764,8 @@ connect_to_socket(const char *name)
|
|||
|
||||
if (name == NULL)
|
||||
name = getenv("WAYLAND_DISPLAY");
|
||||
if (name == NULL) {
|
||||
wl_log("error: WAYLAND_DISPLAY not set in the environment.\n");
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
if (name == NULL)
|
||||
name = "wayland-0";
|
||||
|
||||
fd = wl_os_socket_cloexec(PF_LOCAL, SOCK_STREAM, 0);
|
||||
if (fd < 0)
|
||||
|
|
@ -872,7 +869,8 @@ wl_display_connect_to_fd(int fd)
|
|||
* \return A \ref wl_display object or \c NULL on failure
|
||||
*
|
||||
* Connect to the Wayland display named \c name. If \c name is \c NULL,
|
||||
* its value will be replaced with the WAYLAND_DISPLAY environment variable.
|
||||
* its value will be replaced with the WAYLAND_DISPLAY environment
|
||||
* variable if it is set, otherwise display "wayland-0" will be used.
|
||||
*
|
||||
* \memberof wl_display
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue