Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.12.3
-
None
-
-
400fb27208ae32b9080e12b17d875179b27689f4 (qt/qtbase/dev)
Description
We currently use XDG_SESSION_TYPE for detecting whether to use Wayland or XCB, but that environment variable is a non-standardized part of systemd, and for instance not set by compositors when started from the command line.
Sway users often complain about this.
If we check WAYLAND_DISPLAY, instead, we can cover more cases. Although libwayland defaults to wayland-0 if WAYLAND_DISPLAY is not set, the general consensus in the wayland community seems to be that compositors should set WAYLAND_DISPLAY, and that adding the default to libwayland was a mistake. Therefore, we can be reasonably sure that a compositor is going to set WAYLAND_DISPLAY.