Closed codingHahn closed 3 years ago
Strong likelihood that even though the XDG_CURRENT_DESKTOP
env var is set where you can see it, it is not set in such a way that dbus can see it.
Can you paste the output of:
< "/proc/$(pidof xdg-desktop-portal)/environ" tr '\0' '\n' | grep '^XDG_CURRENT_DESKTOP='
In general, you may find the troubleshooting guide in the wiki helpful. Some suggestions are written assuming systemd, but you may find it points you in the right direction.
Yeah sure:
$ sudo < "/proc/$(pidof xdg-desktop-portal)/environ" tr '\0' '\n' | grep '^XDG_CURRENT_DESKTOP='
XDG_CURRENT_DESKTOP=sway
Whelp, that was the easy fix. Lemme reread these logs and think about this one. I'm betting it has something to do with you being systemd-less, but I don't have much experience with dbus activation.
I hate to say it, but I'm stumped. If xdg sees XDG_CURRENT_DESKTOP=sway
than its decision logic is pretty straight forward, and I don't understand why it claims to fall back to gtk. And your edit to the portal definition proves it knows about the wlr implementation of screencast.
I would suggest raising an issue for the folks at xdg-desktop-portal referencing this one. Leave this open and I'll follow both in case I can help or I think of anything else to try.
You might consider directly invoking xdp from a shell like this:
XDG_CURRENT_DESKTOP=sway /path/to/xdg-desktop-portal -vr
See if that still falls back or correctly chooses the wlr portal. If it falls back, definitely an xdp bug. If not, I'm guessing a really subtle config typo somewhere, or a strange d-bus activation environment variable sync race condition.
It was after all an env problem. Because voidlinux is not using systemd and sway does not automatically propagate env vars to dbus, I needed to do that myself. Putting this at the top of the sway config fixed it:
exec dbus-update-activation-environment DISPLAY XAUTHORITY SWAYSOCK I3SOCK WAYLAND_DISPLAY
First, I don't know if this is a bug in
xdg-desktop-portal{,-wlr,-gtk}
or Void Linux. I am sorry if this is the wrong place.With the default configuration, the wrong implementation for the ScreenCast portal gets chosen.
Distro: Void Linux Arch: x86_64 xdg-desktop-portal 1.8.1 xdg-desktop-portal-wlr 0.4.0 xdg-desktop-portal-gtk 1.8.0
The value of the
XDG_CURRENT_DESKTOP
env var issway
When having both
xdg-desktop-portal-wlr
andxdg-desktop-portal-gtk
installed and running sway, the ScreenCast implementation from gtk gets used. Here is the output of xdg-desktop-portal:And here is the output of
xdg-desktop-portal-wlr
When I then edit the file at
/usr/share/xdg-desktop-portal/portals/gtk.portal
to remove the ScreenShare implementation and restartxdg-desktop-portal
, the output is the following:It automatically chooses the wrong implementation, thus rendering screenshare impossible.