Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-25 Thread Pekka Paalanen
On Tue, 25 Aug 2015 09:23:00 +0200
Olivier Fourdan four...@gmail.com wrote:

 Hi all,
 
 On 24 August 2015 at 11:56, Pekka Paalanen pekka.paala...@collabora.co.uk
 wrote
 
  Pushed:
 c0636dd..c7dbaa1  master - master
 
 
 Quick question, is the answer/suggestion I received back at the time here:
 
 http://lists.freedesktop.org/archives/wayland-devel/2015-July/023729.html
 
 still valid with this revert applied?

Hi,

well, it depends. If the XWayland server is started from the Wayland
compositor, it should have WAYLAND_DISPLAY set because compositors
usually set it.

I'm not sure what people would think of a compositor that doesn't set
WAYLAND_DISPLAY in case the default socket is used.

I think your question is still lacking a solid answer.


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-25 Thread Olivier Fourdan
Hi all,

On 24 August 2015 at 11:56, Pekka Paalanen pekka.paala...@collabora.co.uk
wrote

 Pushed:
c0636dd..c7dbaa1  master - master


Quick question, is the answer/suggestion I received back at the time here:

http://lists.freedesktop.org/archives/wayland-devel/2015-July/023729.html

still valid with this revert applied?

Thanks
Olivier
​
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-24 Thread Pekka Paalanen
On Mon, 17 Aug 2015 16:17:57 +0300
Pekka Paalanen ppaala...@gmail.com wrote:

 From: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.
 
 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 d...@gmail.com
 Cc: Giulio Camuffo giuliocamu...@gmail.com
 Cc: Daniel Stone dan...@fooishbar.org
 Cc: Jasper St. Pierre jstpie...@mecheye.net
 Cc: Ryo Munakata ryomnk...@gmail.com
 Cc: Ray Strode halfl...@gmail.com
 Cc: Peter Hutterer peter.hutte...@who-t.net
 Cc: Matthias Clasen mcla...@redhat.com
 Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 ---
  doc/man/wl_display_connect.xml|  5 +++--
  doc/publican/sources/Protocol.xml |  8 
  src/wayland-client.c  | 10 --
  3 files changed, 11 insertions(+), 12 deletions(-)

Pushed:
   c0636dd..c7dbaa1  master - master


Thanks,
pq
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-23 Thread Ryo Munakata

Although I personally like the current behavior, I think this revert is 
reasonable.

Acked-By: Ryo Munakata ryomnk...@gmail.com

Thanks.

On Mon, 17 Aug 2015 16:17:57 +0300
Pekka Paalanen ppaala...@gmail.com wrote:

 From: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.
 
 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 d...@gmail.com
 Cc: Giulio Camuffo giuliocamu...@gmail.com
 Cc: Daniel Stone dan...@fooishbar.org
 Cc: Jasper St. Pierre jstpie...@mecheye.net
 Cc: Ryo Munakata ryomnk...@gmail.com
 Cc: Ray Strode halfl...@gmail.com
 Cc: Peter Hutterer peter.hutte...@who-t.net
 Cc: Matthias Clasen mcla...@redhat.com
 Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 ---
  doc/man/wl_display_connect.xml|  5 +++--
  doc/publican/sources/Protocol.xml |  8 
  src/wayland-client.c  | 10 --
  3 files changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/doc/man/wl_display_connect.xml b/doc/man/wl_display_connect.xml
 index ded3cbd..7e6e05c 100644
 --- a/doc/man/wl_display_connect.xml
 +++ b/doc/man/wl_display_connect.xml
 @@ -57,8 +57,9 @@
that was previously opened by a Wayland server. The server socket 
 must
be placed in envarXDG_RUNTIME_DIR/envar for this function to
find it. The varnamename/varname argument specifies the name of
 -  the socket or constantNULL/constant to use the default
 -  (which is the value of envarWAYLAND_DISPLAY/envar). If
 +  the socket or constantNULL/constant to use the default (which 
 is
 +  constantwayland-0/constant). The environment variable
 +  envarWAYLAND_DISPLAY/envar replaces the default value. If
envarWAYLAND_SOCKET/envar is set, this function behaves like
functionwl_display_connect_to_fd/function with the 
 file-descriptor
number taken from the environment variable./para
 diff --git a/doc/publican/sources/Protocol.xml 
 b/doc/publican/sources/Protocol.xml
 index 9464953..477063b 100644
 --- a/doc/publican/sources/Protocol.xml
 +++ b/doc/publican/sources/Protocol.xml
 @@ -60,10 +60,10 @@
  titleWire Format/title
  para
The protocol is sent over a UNIX domain stream socket, where the 
 endpoint
 -  name is determined by the emphasisWAYLAND_DISPLAY/emphasis
 -  environment variable.  Its value will usually be
 -  systemitem class=servicewayland-0/systemitem.  The protocol is 
 message-based.
 -  A message sent by a client to the server is called request.  A message
 +  usually is named systemitem class=servicewayland-0/systemitem
 +  (although it can be changed via emphasisWAYLAND_DISPLAY/emphasis
 +  in the environment).  The protocol is message-based.  A
 +  message sent by a client to the server is called request.  A message
from the server to a client is called event.  Every message is
structured as 32-bit words, values are represented in the host's
byte-order.
 diff --git a/src/wayland-client.c b/src/wayland-client.c
 index ffbca4b..09c594a 100644
 --- a/src/wayland-client.c
 +++ b/src/wayland-client.c
 @@ -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.
   *
   * 

Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-23 Thread Peter Hutterer
On Mon, Aug 17, 2015 at 04:17:57PM +0300, Pekka Paalanen wrote:
 From: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.
 
 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

not a big fan of it, but Acked-by: Peter Hutterer peter.hutte...@who-t.net

Cheers,
   Peter

 
 Cc: Dima Ryazanov d...@gmail.com
 Cc: Giulio Camuffo giuliocamu...@gmail.com
 Cc: Daniel Stone dan...@fooishbar.org
 Cc: Jasper St. Pierre jstpie...@mecheye.net
 Cc: Ryo Munakata ryomnk...@gmail.com
 Cc: Ray Strode halfl...@gmail.com
 Cc: Peter Hutterer peter.hutte...@who-t.net
 Cc: Matthias Clasen mcla...@redhat.com
 Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 ---
  doc/man/wl_display_connect.xml|  5 +++--
  doc/publican/sources/Protocol.xml |  8 
  src/wayland-client.c  | 10 --
  3 files changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/doc/man/wl_display_connect.xml b/doc/man/wl_display_connect.xml
 index ded3cbd..7e6e05c 100644
 --- a/doc/man/wl_display_connect.xml
 +++ b/doc/man/wl_display_connect.xml
 @@ -57,8 +57,9 @@
that was previously opened by a Wayland server. The server socket 
 must
be placed in envarXDG_RUNTIME_DIR/envar for this function to
find it. The varnamename/varname argument specifies the name of
 -  the socket or constantNULL/constant to use the default
 -  (which is the value of envarWAYLAND_DISPLAY/envar). If
 +  the socket or constantNULL/constant to use the default (which 
 is
 +  constantwayland-0/constant). The environment variable
 +  envarWAYLAND_DISPLAY/envar replaces the default value. If
envarWAYLAND_SOCKET/envar is set, this function behaves like
functionwl_display_connect_to_fd/function with the 
 file-descriptor
number taken from the environment variable./para
 diff --git a/doc/publican/sources/Protocol.xml 
 b/doc/publican/sources/Protocol.xml
 index 9464953..477063b 100644
 --- a/doc/publican/sources/Protocol.xml
 +++ b/doc/publican/sources/Protocol.xml
 @@ -60,10 +60,10 @@
  titleWire Format/title
  para
The protocol is sent over a UNIX domain stream socket, where the 
 endpoint
 -  name is determined by the emphasisWAYLAND_DISPLAY/emphasis
 -  environment variable.  Its value will usually be
 -  systemitem class=servicewayland-0/systemitem.  The protocol is 
 message-based.
 -  A message sent by a client to the server is called request.  A message
 +  usually is named systemitem class=servicewayland-0/systemitem
 +  (although it can be changed via emphasisWAYLAND_DISPLAY/emphasis
 +  in the environment).  The protocol is message-based.  A
 +  message sent by a client to the server is called request.  A message
from the server to a client is called event.  Every message is
structured as 32-bit words, values are represented in the host's
byte-order.
 diff --git a/src/wayland-client.c b/src/wayland-client.c
 index ffbca4b..09c594a 100644
 --- a/src/wayland-client.c
 +++ b/src/wayland-client.c
 @@ -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
   */
 -- 
 2.4.6
 

Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-21 Thread Pekka Paalanen
On Thu, 20 Aug 2015 16:24:10 -0700
Bryce Harrington br...@osg.samsung.com wrote:

 On Thu, Aug 20, 2015 at 02:18:07PM -0400, Ray Strode wrote:
  Hi,
  
   All of these arguments makes sense, so I guess I agree with reverting this
   change.
 
 +1
 
 Reviewed-by: Bryce Harrington br...@osg.samsung.com
 
  Great.  pq are going to push before the beta?
 
 Yes, the right time to revert it is before the release.  Unless there's
 any objection I can handle it if pq doesn't get to it first.

Hi,

yeah, my all intentions are to get this is in before the beta, and I
think Bryce can guarantee that.

I have been waiting for acks from the same people that acked the
original patch, or hearing objections, but it's been fairly quiet.
Maybe LPC... Only Dima from those people has acked so far and now
Bryce. Should be enough I guess, sometimes I err on the careful side.

Anyway, there is no hurry as beta is still a week away. Let's see who
pushes it first. :-)


Thanks,
pq


pgpDCJITJmPxL.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-20 Thread Bryce Harrington
On Thu, Aug 20, 2015 at 02:18:07PM -0400, Ray Strode wrote:
 Hi,
 
  All of these arguments makes sense, so I guess I agree with reverting this
  change.

+1

Reviewed-by: Bryce Harrington br...@osg.samsung.com

 Great.  pq are going to push before the beta?

Yes, the right time to revert it is before the release.  Unless there's
any objection I can handle it if pq doesn't get to it first.

Bryce
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-20 Thread Ray Strode
Hi,

 All of these arguments makes sense, so I guess I agree with reverting this
 change.
Great.  pq are going to push before the beta?

--Ray
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-18 Thread Sjoerd Simons
On Mon, 2015-08-17 at 16:17 +0300, Pekka Paalanen wrote:
 From: Pekka Paalanen pekka.paala...@collabora.co.uk
 
 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

Acked-By: Sjoerd Simons sjoerd.sim...@collabora.co.uk

 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 d...@gmail.com
 Cc: Giulio Camuffo giuliocamu...@gmail.com
 Cc: Daniel Stone dan...@fooishbar.org
 Cc: Jasper St. Pierre jstpie...@mecheye.net
 Cc: Ryo Munakata ryomnk...@gmail.com
 Cc: Ray Strode halfl...@gmail.com
 Cc: Peter Hutterer peter.hutte...@who-t.net
 Cc: Matthias Clasen mcla...@redhat.com
 Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
 Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
 ---
  doc/man/wl_display_connect.xml|  5 +++--
  doc/publican/sources/Protocol.xml |  8 
  src/wayland-client.c  | 10 --
  3 files changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/doc/man/wl_display_connect.xml 
 b/doc/man/wl_display_connect.xml
 index ded3cbd..7e6e05c 100644
 --- a/doc/man/wl_display_connect.xml
 +++ b/doc/man/wl_display_connect.xml
 @@ -57,8 +57,9 @@
that was previously opened by a Wayland server. The server 
 socket must
be placed in envarXDG_RUNTIME_DIR/envar for this 
 function to
find it. The varnamename/varname argument specifies 
 the name of
 -  the socket or constantNULL/constant to use the default
 -  (which is the value of envarWAYLAND_DISPLAY/envar). If
 +  the socket or constantNULL/constant to use the default 
 (which is
 +  constantwayland-0/constant). The environment 
 variable
 +  envarWAYLAND_DISPLAY/envar replaces the default value. 
 If
envarWAYLAND_SOCKET/envar is set, this function 
 behaves like
functionwl_display_connect_to_fd/function with the 
 file-descriptor
number taken from the environment variable./para
 diff --git a/doc/publican/sources/Protocol.xml 
 b/doc/publican/sources/Protocol.xml
 index 9464953..477063b 100644
 --- a/doc/publican/sources/Protocol.xml
 +++ b/doc/publican/sources/Protocol.xml
 @@ -60,10 +60,10 @@
  titleWire Format/title
  para
The protocol is sent over a UNIX domain stream socket, where 
 the endpoint
 -  name is determined by the emphasisWAYLAND_DISPLAY/emphasis
 -  environment variable.  Its value will usually be
 -  systemitem class=servicewayland-0/systemitem.  The 
 protocol is message-based.
 -  A message sent by a client to the server is called request.  A 
 message
 +  usually is named systemitem class=servicewayland
 -0/systemitem
 +  (although it can be changed via 
 emphasisWAYLAND_DISPLAY/emphasis
 +  in the environment).  The protocol is message-based.  A
 +  message sent by a client to the server is called request.  A 
 message
from the server to a client is called event.  Every message is
structured as 32-bit words, values are represented in the 
 host's
byte-order.
 diff --git a/src/wayland-client.c b/src/wayland-client.c
 index ffbca4b..09c594a 100644
 --- a/src/wayland-client.c
 +++ b/src/wayland-client.c
 @@ -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
   */

-- 
Sjoerd Simons 

Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-18 Thread Sjoerd Simons
On Mon, 2015-08-17 at 09:58 -0700, Bill Spitzak wrote:
 On Mon, Aug 17, 2015 at 7:48 AM, Ray Strode halfl...@gmail.com 
 wrote:
 
  Hi,
  
   This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.
  
  thanks, you've got my vote.
  
  Acked-by: Ray Strode rstr...@redhat.com
  
  --Ray
 
 
 Seems right to me question about the method of nesting Wayland in X 
 and X
 in wayland;
 
  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.
 
 If Wayland is already running and using wayland-0 this would prevent 
 these
 programs from using the X11 api. For instance if you wished to test 
 the X11
 api inside a Wayland session.

Not really it just means you require a way to override the order in
which they try their display backends (which e.g. for Gtk+ is
possible). As Ray previously mentioned, keeping environment variables
for corner cases is entirely fine.

 Would it make sense that if DISPLAY is set and WAYLAND_DISPLAY is not 
 set,
 that a program capable of doing both should prefer the X11 api? This 
 would
 mean that I could force use of the X11 api by unsetting 
 WAYLAND_DISPLAY.

That seems rather fragile (and really up to the toolkit/program to
implement, wayland can't know if the program supports X11).

 This will require changes to the client (unless the wayland connect  was
 changed to fail in this case, which I suspect is not a good idea) 
 which
 probably explains why the idea of renaming the socket was suggested.
 
 As for the patch, I agree. The Foundry software would check if 
 DISPLAY was
 not set, and set it directly to :0, so that X would work always (it 
 did
 not open the display by name because it wanted to fix child programs 
 as
 well). This was commercial software and this was demanded by qc. So
 effectively they wanted X11 to work without an environment variable.

the problem with DISPLAY is that it's not namespaced per user, so if
you have two users logged in on an X graphical session one will have 
 e.g. DISPLAY=:0 the other DISPLAY=:1. Because of that defaulting to :0
on X isn't a great idea on multi-user systems.

However for wayland, the sockets are namespaced per user as they reside
in their respective XDG_RUNTIME_DIR, which means two people can start a
graphical session and both use wayland-0 for their compositor just
fine.

-- 
Sjoerd Simons sjoerd.sim...@collabora.co.uk
Collabora Ltd.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-18 Thread Dima Ryazanov
All of these arguments makes sense, so I guess I agree with reverting this
change. I didn't know about the goal of reducing the number of environment
variables. Also, the fact that wayland displays are per user makes it
different from the X11 displays. Sorry for all the trouble!

On Tue, Aug 18, 2015 at 12:34 AM, Sjoerd Simons 
sjoerd.sim...@collabora.co.uk wrote:

 On Mon, 2015-08-17 at 09:58 -0700, Bill Spitzak wrote:
  On Mon, Aug 17, 2015 at 7:48 AM, Ray Strode halfl...@gmail.com
  wrote:
 
   Hi,
  
This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.
  
   thanks, you've got my vote.
  
   Acked-by: Ray Strode rstr...@redhat.com
  
   --Ray
 
 
  Seems right to me question about the method of nesting Wayland in X
  and X
  in wayland;
 
   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.
 
  If Wayland is already running and using wayland-0 this would prevent
  these
  programs from using the X11 api. For instance if you wished to test
  the X11
  api inside a Wayland session.

 Not really it just means you require a way to override the order in
 which they try their display backends (which e.g. for Gtk+ is
 possible). As Ray previously mentioned, keeping environment variables
 for corner cases is entirely fine.

  Would it make sense that if DISPLAY is set and WAYLAND_DISPLAY is not
  set,
  that a program capable of doing both should prefer the X11 api? This
  would
  mean that I could force use of the X11 api by unsetting
  WAYLAND_DISPLAY.

 That seems rather fragile (and really up to the toolkit/program to
 implement, wayland can't know if the program supports X11).

  This will require changes to the client (unless the wayland connect  was
  changed to fail in this case, which I suspect is not a good idea)
  which
  probably explains why the idea of renaming the socket was suggested.
 
  As for the patch, I agree. The Foundry software would check if
  DISPLAY was
  not set, and set it directly to :0, so that X would work always (it
  did
  not open the display by name because it wanted to fix child programs
  as
  well). This was commercial software and this was demanded by qc. So
  effectively they wanted X11 to work without an environment variable.

 the problem with DISPLAY is that it's not namespaced per user, so if
 you have two users logged in on an X graphical session one will have
  e.g. DISPLAY=:0 the other DISPLAY=:1. Because of that defaulting to :0
 on X isn't a great idea on multi-user systems.

 However for wayland, the sockets are namespaced per user as they reside
 in their respective XDG_RUNTIME_DIR, which means two people can start a
 graphical session and both use wayland-0 for their compositor just
 fine.

 --
 Sjoerd Simons sjoerd.sim...@collabora.co.uk
 Collabora Ltd.


___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Pekka Paalanen
From: Pekka Paalanen pekka.paala...@collabora.co.uk

This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

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 d...@gmail.com
Cc: Giulio Camuffo giuliocamu...@gmail.com
Cc: Daniel Stone dan...@fooishbar.org
Cc: Jasper St. Pierre jstpie...@mecheye.net
Cc: Ryo Munakata ryomnk...@gmail.com
Cc: Ray Strode halfl...@gmail.com
Cc: Peter Hutterer peter.hutte...@who-t.net
Cc: Matthias Clasen mcla...@redhat.com
Cc: Sjoerd Simons sjoerd.sim...@collabora.co.uk
Signed-off-by: Pekka Paalanen pekka.paala...@collabora.co.uk
---
 doc/man/wl_display_connect.xml|  5 +++--
 doc/publican/sources/Protocol.xml |  8 
 src/wayland-client.c  | 10 --
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/doc/man/wl_display_connect.xml b/doc/man/wl_display_connect.xml
index ded3cbd..7e6e05c 100644
--- a/doc/man/wl_display_connect.xml
+++ b/doc/man/wl_display_connect.xml
@@ -57,8 +57,9 @@
   that was previously opened by a Wayland server. The server socket 
must
   be placed in envarXDG_RUNTIME_DIR/envar for this function to
   find it. The varnamename/varname argument specifies the name of
-  the socket or constantNULL/constant to use the default
-  (which is the value of envarWAYLAND_DISPLAY/envar). If
+  the socket or constantNULL/constant to use the default (which is
+  constantwayland-0/constant). The environment variable
+  envarWAYLAND_DISPLAY/envar replaces the default value. If
   envarWAYLAND_SOCKET/envar is set, this function behaves like
   functionwl_display_connect_to_fd/function with the 
file-descriptor
   number taken from the environment variable./para
diff --git a/doc/publican/sources/Protocol.xml 
b/doc/publican/sources/Protocol.xml
index 9464953..477063b 100644
--- a/doc/publican/sources/Protocol.xml
+++ b/doc/publican/sources/Protocol.xml
@@ -60,10 +60,10 @@
 titleWire Format/title
 para
   The protocol is sent over a UNIX domain stream socket, where the endpoint
-  name is determined by the emphasisWAYLAND_DISPLAY/emphasis
-  environment variable.  Its value will usually be
-  systemitem class=servicewayland-0/systemitem.  The protocol is 
message-based.
-  A message sent by a client to the server is called request.  A message
+  usually is named systemitem class=servicewayland-0/systemitem
+  (although it can be changed via emphasisWAYLAND_DISPLAY/emphasis
+  in the environment).  The protocol is message-based.  A
+  message sent by a client to the server is called request.  A message
   from the server to a client is called event.  Every message is
   structured as 32-bit words, values are represented in the host's
   byte-order.
diff --git a/src/wayland-client.c b/src/wayland-client.c
index ffbca4b..09c594a 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -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
  */
-- 
2.4.6

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Ray Strode
Hi,

 This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

thanks, you've got my vote.

Acked-by: Ray Strode rstr...@redhat.com

--Ray
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland] Revert client: require WAYLAND_DISPLAY to be set

2015-08-17 Thread Bill Spitzak
On Mon, Aug 17, 2015 at 7:48 AM, Ray Strode halfl...@gmail.com wrote:

 Hi,

  This reverts commit fb7e13021730d0a5516ecbd3712ea4235e05d24d.

 thanks, you've got my vote.

 Acked-by: Ray Strode rstr...@redhat.com

 --Ray


Seems right to me question about the method of nesting Wayland in X and X
in wayland;

 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.

If Wayland is already running and using wayland-0 this would prevent these
programs from using the X11 api. For instance if you wished to test the X11
api inside a Wayland session.

Would it make sense that if DISPLAY is set and WAYLAND_DISPLAY is not set,
that a program capable of doing both should prefer the X11 api? This would
mean that I could force use of the X11 api by unsetting WAYLAND_DISPLAY.

This will require changes to the client (unless the wayland connect was
changed to fail in this case, which I suspect is not a good idea) which
probably explains why the idea of renaming the socket was suggested.

As for the patch, I agree. The Foundry software would check if DISPLAY was
not set, and set it directly to :0, so that X would work always (it did
not open the display by name because it wanted to fix child programs as
well). This was commercial software and this was demanded by qc. So
effectively they wanted X11 to work without an environment variable.
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel