Since this problem got a little too annoying (I was hoping it would fix itself with one of the next updates) I did a bit of digging and found a solution that worked (at least for me, using Firefox)
- Make sure you have
xdg-desktop-portal-wlr
andxdg-desktop-portal
installed - In
$HOME/.config/sway/config
, add the lineinclude /etc/sway/config.d/*
- Your drop-in file
/etc/sway/config.d/50-systemd-user.conf
you should somewhere have the lines
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_CURRENT_DESKTOP=sway
- Restart your computer
systemctl --user show-environment
should haveXDG_CURRENT_DESKTOP=sway
andsystemctl --user status xdg-desktop-portal-wlr.service
should be running.- Screen sharing with Firefox (and probably most other browsers) should work now. On Firefox you can test this under https://mozilla.github.io/webrtc-landing/gum_test.html
(@joekamprad since the community editions will be deprecated, is this still worth opening a PR, adding the line from 2. to the default config?)
Relevant links: