I certainly like that there is a fallback. The user should not have to
set environment variables to get something to work.
In our software using X we always check if DISPLAY is set and if not set
it to ":0". This is so the program just works even if the user's setup
is wrong. (The primary reason though was because we need access to
OpenGL even if there is no GUI running, which I assume (and hope) will
not be a problem with EGL/Gl/Wayland, ie you can get access to this
hardware if it exists, even if you are not allowed to talk to a wayland
compositor).
I do think the proper solution is for gtk+ to check the environment
variables before calling it. Thus it can make up the rules for which one
takes precedence if neither $WAYLAND_DISPLAY or $DISPLAY is set.
Jason Ekstrand wrote:
How do you work around it? What you got from Pekka is half right. You
need to check for both WAYLAND_DISPLAY and WAYLAND_SOCKET. The former
is the catch-all "connect to this socket; it lives in XDG_RUNTIME_DIR."
The other is a mechanism for passing the client a specific file
descriptor that it is expected to use for it's connection. This is
usually used for launching trusted clients such as the panel.
It might be nice if WAYLAND_SOCKET was instead a special value in
WAYLAND_DISPLAY. Or is there a reason a program would need
WAYLAND_DISPLAY if WAYLAND_SOCKET was set?
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel