Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
On Thu, 13 Aug 2015 13:12:42 +1000 Peter Hutterer peter.hutte...@who-t.net wrote: On Wed, Aug 12, 2015 at 02:41:08PM +0300, Pekka Paalanen wrote: On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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: ... gathering the comments from the thread, it seems we have Acked-bys from: Pekka Paalanen ppaala...@gmail.com Giulio Camuffo giuliocamu...@gmail.com Daniel Stone dan...@fooishbar.org Jasper St. Pierre jstpie...@mecheye.net Seems like a pretty strong set. Would you like to send a non-RFC version of this patch? I think you can include also the above Acked-bys. if you need another vote to tilt the favours, you can add Acked-by: Peter Hutterer peter.hutte...@who-t.net sorry, didn't see this earlier. Hi Peter, thanks, and sorry I didn't see your reply before I pushed. :-D - pq pgpA_ZKnfYc2T.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] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
Hi, thanks, and sorry I didn't see your reply before I pushed. :-D So this commit totally broke gtk+. Thread 1 (Thread 0x7f3813651980 (LWP 537)): #0 g_logv (log_domain=0x7f38128b01ce Gdk, log_level=G_LOG_LEVEL_ERROR, format=optimized out, args=optimized out) at ../../glib/gmessages.c:1078 #1 0x7f380edd30cd in wl_log (fmt=fmt@entry=0x7f380edd31b8 error: WAYLAND_DISPLAY not set in the environment.\n) at ../src/wayland-util.c:385 #2 0x7f380edd0115 in connect_to_socket (name=0x0) at ../src/wayland-client.c:768 #3 wl_display_connect (name=name@entry=0x0) at ../src/wayland-client.c:899 #4 0x7f38128a5f7e in _gdk_wayland_display_open (display_name=0x0) at ../../../gdk/wayland/gdkdisplay-wayland.c:443 #5 0x7f381285b357 in gdk_display_manager_open_display (manager=optimized out, name=0x0) at ../../gdk/gdkdisplaymanager.c:463 #6 0x7f3812d24c10 in gtk_init_check (argc=optimized out, argv=optimized out) at ../../gtk/gtkmain.c:1011 #7 0x7f3812d24c49 in gtk_init (argc=optimized out, argv=optimized out) at ../../gtk/gtkmain.c:1068 #8 0x00400e11 in main (argc=0, argv=0x0) at ../../tools/gnome-session-check-accelerated.c:121 gtk+ treats wl_log messages as fatal errors. See this commit from krh: https://git.gnome.org/browse/gtk+/commit/?id=4252ac6d6ce2a02efa0991fc0723f9522aff7a0f Gtk+ also uses its wayland backend by default, so after this change, it now dies instead of falings back to the x11 backend on non-wayland sessions. I've filed https://bugzilla.gnome.org/show_bug.cgi?id=753635 to change gtk+'s default behavior to treat wayland errors as debug messages now. Still, I think this change is wrong headed. We've been trying to cleave ourselves from environment variables for years in the default case. Having to set this seems like a step backward. This means having to jump through additional hoops when using systemd --user sessions, it means having to jump through an additional hoop when running a program from a VT, and it means having to jump through an additional hoop when ssh'ing in to debug something. if a user runs a program it should show up on the default display in a clean environment. save the environment variables for fringe cases like nested compositors. The problem purportedly getting fixed gives this as a rationale: 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). It's wrong to say there's no good way to prevent programs from launching on weston. This corner case, can be covered by setting the GDK_BACKEND environment variable. edge cases should use environment variables not the default case. Furthermore, the commit says it's trying to fix a scenario where the user is logged into X, but the commit actually breaks X logins (because of the above log handler issue)! That means it wasn't tested. I don't think the commit is good idea at all, can we revert it ? XDG_RUNTIME_DIR is supposed to free us from other environment variables. --Ray ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
On Wed, Aug 12, 2015 at 02:41:08PM +0300, Pekka Paalanen wrote: On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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. Signed-off-by: Dima Ryazanov d...@gmail.com Hi, gathering the comments from the thread, it seems we have Acked-bys from: Pekka Paalanen ppaala...@gmail.com Giulio Camuffo giuliocamu...@gmail.com Daniel Stone dan...@fooishbar.org Jasper St. Pierre jstpie...@mecheye.net Seems like a pretty strong set. Would you like to send a non-RFC version of this patch? I think you can include also the above Acked-bys. if you need another vote to tilt the favours, you can add Acked-by: Peter Hutterer peter.hutte...@who-t.net sorry, didn't see this earlier. Cheers, Peter ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
Sounds good, will do! On Wed, Aug 12, 2015 at 4:41 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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. Signed-off-by: Dima Ryazanov d...@gmail.com Hi, gathering the comments from the thread, it seems we have Acked-bys from: Pekka Paalanen ppaala...@gmail.com Giulio Camuffo giuliocamu...@gmail.com Daniel Stone dan...@fooishbar.org Jasper St. Pierre jstpie...@mecheye.net Seems like a pretty strong set. Would you like to send a non-RFC version of this patch? I think you can include also the above Acked-bys. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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. Signed-off-by: Dima Ryazanov d...@gmail.com Hi, gathering the comments from the thread, it seems we have Acked-bys from: Pekka Paalanen ppaala...@gmail.com Giulio Camuffo giuliocamu...@gmail.com Daniel Stone dan...@fooishbar.org Jasper St. Pierre jstpie...@mecheye.net Seems like a pretty strong set. Would you like to send a non-RFC version of this patch? I think you can include also the above Acked-bys. Thanks, pq pgplYDnrdIKku.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] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
Bringing this up again. What do you guys think? Does it make sense to push this change? On Wed, May 27, 2015 at 1:50 AM, Dima Ryazanov d...@gmail.com wrote: (Oops, sent too soon by accident.) Yep, DISPLAY always needs to be set - and I figured, there's a reason it is that way, so that's actually why I thought it made sense to use the same convention for WAYLAND_DISPLAY. Also, regarding Bill's first comment: yeah, that certainly works, but it feels like a workaround. It only gets more complicated if the app supports more backends - framebuffer, etc. On Wed, May 27, 2015 at 1:45 AM, Dima Ryazanov d...@gmail.com wrote: Yep, DISPLAY always needs to be set - and I figured, there's a reason On Tue, May 26, 2015 at 2:59 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Tue, 26 May 2015 10:40:15 +0100 Daniel Stone dan...@fooishbar.org wrote: Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. Really? ;-) $ export -n DISPLAY $ xterm xterm: Xt error: Can't open display: xterm: DISPLAY is not set Geany and gqview fail to start, and konsole segfaults (lol). Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
I'm for it as well. On Wed, Jun 24, 2015 at 9:53 AM, Dima Ryazanov d...@gmail.com wrote: Bringing this up again. What do you guys think? Does it make sense to push this change? On Wed, May 27, 2015 at 1:50 AM, Dima Ryazanov d...@gmail.com wrote: (Oops, sent too soon by accident.) Yep, DISPLAY always needs to be set - and I figured, there's a reason it is that way, so that's actually why I thought it made sense to use the same convention for WAYLAND_DISPLAY. Also, regarding Bill's first comment: yeah, that certainly works, but it feels like a workaround. It only gets more complicated if the app supports more backends - framebuffer, etc. On Wed, May 27, 2015 at 1:45 AM, Dima Ryazanov d...@gmail.com wrote: Yep, DISPLAY always needs to be set - and I figured, there's a reason On Tue, May 26, 2015 at 2:59 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Tue, 26 May 2015 10:40:15 +0100 Daniel Stone dan...@fooishbar.org wrote: Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. Really? ;-) $ export -n DISPLAY $ xterm xterm: Xt error: Can't open display: xterm: DISPLAY is not set Geany and gqview fail to start, and konsole segfaults (lol). Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel -- Jasper ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
Yep, DISPLAY always needs to be set - and I figured, there's a reason On Tue, May 26, 2015 at 2:59 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Tue, 26 May 2015 10:40:15 +0100 Daniel Stone dan...@fooishbar.org wrote: Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. Really? ;-) $ export -n DISPLAY $ xterm xterm: Xt error: Can't open display: xterm: DISPLAY is not set Geany and gqview fail to start, and konsole segfaults (lol). Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
(Oops, sent too soon by accident.) Yep, DISPLAY always needs to be set - and I figured, there's a reason it is that way, so that's actually why I thought it made sense to use the same convention for WAYLAND_DISPLAY. Also, regarding Bill's first comment: yeah, that certainly works, but it feels like a workaround. It only gets more complicated if the app supports more backends - framebuffer, etc. On Wed, May 27, 2015 at 1:45 AM, Dima Ryazanov d...@gmail.com wrote: Yep, DISPLAY always needs to be set - and I figured, there's a reason On Tue, May 26, 2015 at 2:59 AM, Pekka Paalanen ppaala...@gmail.com wrote: On Tue, 26 May 2015 10:40:15 +0100 Daniel Stone dan...@fooishbar.org wrote: Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. Really? ;-) $ export -n DISPLAY $ xterm xterm: Xt error: Can't open display: xterm: DISPLAY is not set Geany and gqview fail to start, and konsole segfaults (lol). Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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. Need more opinions. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
On Tue, 26 May 2015 10:40:15 +0100 Daniel Stone dan...@fooishbar.org wrote: Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. Really? ;-) $ export -n DISPLAY $ xterm xterm: Xt error: Can't open display: xterm: DISPLAY is not set Geany and gqview fail to start, and konsole segfaults (lol). Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: On Mon, 25 May 2015 01:12:15 -0700 Dima Ryazanov d...@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@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
Hi, On 26 May 2015 at 10:26, Giulio Camuffo giuliocamu...@gmail.com wrote: 2015-05-26 12:21 GMT+03:00 Pekka Paalanen ppaala...@gmail.com: 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. Probably to match X11's behaviour of using :0 in the absence of a $DISPLAY. 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. Agreed. It would be nice if this just worked out of the box, but I think the answer is maybe to work with the much better integration we have today with, e.g., logind to push a default $WAYLAND_DISPLAY to TTY/SSH users if that's desired. Cheers, Daniel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH wayland] RFC: Require WAYLAND_DISPLAY to be set instead of using wayland-0 as the default
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. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel