Discussion:
Question about the XDG_SESSION_TYPE environmental variable
Michal Srb
2018-07-20 07:19:14 UTC
Permalink
Hi,

Is there some documentation for the XDG_SESSION_TYPE environmental variable?
So far the only think I managed to find is the pam_systemd manual page.

I have observed that multiple display managers (at least GDM, SDDM and
LightDM) set this variable and some applications use it to determine the type
of current session. Also the Qt toolkit uses it to decide if it should
prioritize the X11 or Wayland backend.

IMHO that usage makes sense, because in some situations both X11 and Wayland
displays are available and the toolkit needs to know which one is preferred.
If it would unconditionally prefer X11, it may end up using Xwayland when
started from Wayland session. If it would unconditionally prefer Wayland, it
may end up connecting to a completely unrelated "wayland-0" display when
started from X11 session.

GTK currently unconditionally prefer Wayland and I have hit a bug when GTK
applications started from X11 session start in unrelated Wayland session. So I
tried to advocate the use of this variable for backend selection in GTK:
https://gitlab.gnome.org/GNOME/gtk/issues/1224

However the authors are reluctant to use the XDG_SESSION_TYPE variable without
seeing further documentation or some discussion on where it came from. Does
anything like that exist? If not, is there chance the variable will be
"standardized"?

Best regards,
Michal Srb
Lennart Poettering
2018-07-20 08:48:04 UTC
Permalink
Post by Michal Srb
GTK currently unconditionally prefer Wayland and I have hit a bug when GTK
applications started from X11 session start in unrelated Wayland session. So I
https://gitlab.gnome.org/GNOME/gtk/issues/1224
However the authors are reluctant to use the XDG_SESSION_TYPE variable without
seeing further documentation or some discussion on where it came from. Does
anything like that exist? If not, is there chance the variable will be
"standardized"?
I have commented on the bug. TLDR: they have never been formalized as
fdo spec, but they are documented by systemd and are official API of
it. if you want to make them an fdo spec, by all means go ahead, you
have my support, but I am not going to do the work, for me personally
systemd docs are good enough ;-)

Lennart
--
Lennart Poettering, Red Hat
Michal Srb
2018-07-20 10:31:39 UTC
Permalink
Post by Lennart Poettering
I have commented on the bug. TLDR: they have never been formalized as
fdo spec, but they are documented by systemd and are official API of
it. if you want to make them an fdo spec, by all means go ahead, you
have my support, but I am not going to do the work, for me personally
systemd docs are good enough ;-)
Thank you for the comment and explanation.

I will check what would it take to make it into a fdo spec.

Michal

Loading...