Package: sway
Version: 1.11-3
Severity: normal
Dear Maintainer,
When Firefox plays full-screen video content (such as YouTube), it tries to
tell the desktop environment/window manager to avoid blanking the screen for
inactivity. If it fails, watching videos is incredibly frustrating since the
screen keeps turning itself off.
This works perfectly well in a full desktop environment like GNOME, but does
not work under sway.
According to investigations done by user "sincereshellfish" on Reddit[1], the
situation is this:
- when Firefox wants to inhibit screen blanking, it first tries the standard
DBus protocol org.freedesktop.impl.portal.Inhibit, which sway does not
implement
- If that fails, Firefox tries the regular Wayland "inhibit screen blanking"
protocol, which sway *does* implement
- The org.freedesktop.impl.portal.Inhibit DBus protocol is provided by the xdg-
desktop-portal proxy, which forwards it to one of the backends configured by
the /usr/share/xdg-desktop-portal/sway-portals.conf file
- Unfortunately, the protocol does not provide any way to report failure, so
once the proxy has accepted the request, it must either succeed or fail
silently
- As a result, when Firefox tries the standard DBus protocol to inhibit
blanking, it never gets a failure, so it never falls back to the mode that
works with sway
The workaround suggested by the Reddit post is to add the following line to the
sway-portals.conf file:
org.freedesktop.impl.portal.Inhibit=none
This tells xdg-desktop-portal not to advertise the DBus protocol at all, which
means Firefox gets a failure trying to invoke it, so it falls back to the
Wayland protocol, and it Just Works.
I think this would be a good thing to include in the sway-portals.conf file
packaged in Debian.
Thank you!
Timothy Allen
[1]:
https://www.reddit.com/r/swaywm/comments/1dqud2a/how_to_get_firefox_to_inhibit_idle_when_watching/
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.17.13+deb14-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8),
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages sway depends on:
ii libc6 2.42-10+b1
ii libcairo2 1.18.4-3
ii libdrm2 2.4.129-1
ii libevdev2 1.13.6+dfsg-1
ii libgdk-pixbuf-2.0-0 2.44.4+dfsg-1
ii libgl1-mesa-dri 25.2.8-2+b2
ii libglib2.0-0t64 2.86.3-4
ii libinput10 1.30.0-1
ii libjson-c5 0.18+ds-1.1
ii libpango-1.0-0 1.57.0-1
ii libpangocairo-1.0-0 1.57.0-1
ii libpcre2-8-0 10.46-1+b1
ii libpixman-1-0 0.46.4-1+b1
ii libsystemd0 259-1
ii libudev1 259-1
ii libwayland-client0 1.24.0-2+b2
ii libwayland-cursor0 1.24.0-2+b2
ii libwayland-server0 1.24.0-2+b2
ii libwlroots-0.19 0.19.1-1+b1
ii libxcb-icccm4 0.4.2-1+b1
ii libxcb1 1.17.0-2+b2
ii libxkbcommon0 1.12.3-1
ii swaybg 1.2.1-1
Versions of packages sway recommends:
ii foot 1.25.0-1
ii polkitd 127-1
ii wmenu 0.2.0-1
Versions of packages sway suggests:
ii sway-backgrounds 1.11-3
ii swayidle 1.9.0-1
pn swaylock <none>
ii xdg-desktop-portal-gtk 1.15.3-2
pn xdg-desktop-portal-wlr <none>
-- no debconf information