On Thu, 24 Feb 2022 11:38:51 +0100 <[email protected]> wrote:
On 2022-02-23 20:52, Jameson Graef Rollins wrote:
> I might be mischaracterizing this as an Xwayland issue. Maybe it's a
> sway issue?
It's definitely not an Xwayland issue; Xwayland (like any other X server)
itself doesn't set these environment variables or launch any X11 client
processes.
I just ran into this issue. There seems to be a race condition or
ordering issue when first logging in after a boot. Sway will set the
environment varables correctly when
/etc/sway/config.d/50-systemd-user.conf is included in
~/.config/sway/config, but this happens _after_ systemd starts
xdg-desktop-portal-gtk. I confirmed this by adding
ExecStartPre=/usr/bin/echo $DISPLAY $WAYLAND_DISPLAY
to the xdg-desktop-portal-gtk unit. After logging in for the first time
after a boot, systemctl --user status xdg-dekstop-portal-gtk looks like
this:
~~~
Aug 02 10:18:05 hostname systemd[2255]: Starting
xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME
implementation)...
Aug 02 10:18:05 hostname (echo)[2382]: xdg-desktop-portal-gtk.service:
Referenced but unset environment variable evaluates to an empty string:
DISPLAY, WAYLAND_DISPLAY
Aug 02 10:18:05 hostname xdg-desktop-por[2383]: cannot open display:
Aug 02 10:18:05 hostname systemd[2255]: xdg-desktop-portal-gtk.service:
Main process exited, code=exited, status=1/FAILURE
Aug 02 10:18:05 hostname systemd[2255]: xdg-desktop-portal-gtk.service:
Failed with result 'exit-code'.
Aug 02 10:18:05 hostname systemd[2255]: Failed to start
xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
~~~
After a systemctl --user restart xdg-desktop-portal-gtk the variables
are set:
~~~
Aug 02 10:19:39 hostname systemd[2255]: Starting
xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME
implementation)...
Aug 02 10:19:39 hostname echo[2788]: :0 wayland-1
Aug 02 10:19:39 hostname systemd[2255]: Started
xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation).
~~~
Does anyone have an idea how best to fix this? Do we need to add a
dependency to the xdg-desktop-portal-gtk unit? But what dependency?
Best regards,
-- Martin