Repository navigation
Keep the screensaver off while Firefox-family browsers play media - #8955
michielvandermeer wants to merge 1 commit into
Conversation
The idle service only honors Wayland inhibitors. Firefox, Zen, and LibreWolf request inhibit over D-Bus, which nothing owns since hypridle was replaced, so the screensaver fires over playing video. Watch those browsers' MPRIS Playing state and hold idle off for the duration of playback. Fullscreen windows also get a Hyprland idle_inhibit rule for videos that never publish MPRIS.
|
Reviewed at head The bug is real, and #6475 tracks it: Firefox, Zen and LibreWolf ask for idle inhibit through the portal, and on
On the same cause, #7877 is the better fix for Firefox. It adds a single environment variable, while this PR puts 174 lines of player-name matching for one browser family into the idle service. The difference this PR names in its description is real in principle: Firefox attaches its Wayland inhibitor to the focused window, and Hyprland honours an inhibitor only while that window is visible. Playback started in an unfocused window, or left running on another workspace, may not hold idle off under #7877. That has not been reproduced here. If the maintainer wants that case covered, the D-Bus service in #13359 covers it for every app, not just Firefox. Reading this PR's code, I found no defect. The No second opinion this time: the reviewer (Codex Medium) answered a ping, but today's review budget was spent, so this reading is one model's (Claude Opus 5.5). This is waiting on the maintainer to choose between the fixes; nothing is needed from the author. |
Fixes #7220. Fixes #7199. Related to #6475.
What happens today
Quattro's idle service uses
IdleMonitor { respectInhibitors: true }, which only honors Waylandzwp_idle_inhibit_manager_v1inhibitors. Firefox, Zen, and LibreWolf request idle inhibit over the GTK portal /org.freedesktop.ScreenSaverwhile a<video>is playing. Nothing owns that bus name since hypridle was replaced, so the call is a silent no-op and the screensaver comes up over YouTube, Plex, and the rest — windowed or fullscreen.Chromium-based browsers already speak the Wayland protocol directly and are unaffected.
Reproduced on Omarchy 4.0.1 with Firefox 154 playing Plex in a windowed window:
hyprctl clientsshowedinhibitingIdle: falsewhile MPRISPlaybackStatuswasPlaying. Tagging the windownoidle(the existingidle_inhibit = alwaysrule) immediately setinhibitingIdle: true.What this does
idle_inhibit = fullscreen, so fullscreen video that never publishes MPRIS still holds idle off.idle togglenow flipsstayAwakerather than the derivedidleEnabledflag, so Stay Awake still toggles correctly while media is inhibiting.Idle browsing with Firefox open is unchanged. You only skip the screensaver while media is actually playing.
Why not the other open PRs
MOZ_WAKE_LOCK_TYPE=WaylandIdleInhibit. That is the right native backend when it works, but Firefox's Wayland inhibit is attached to the focused surface and can fail (or stick failed) if playback starts unfocused. This PR does not need Firefox to inhibit anything.org.freedesktop.ScreenSaverfor every D-Bus client (VLC, Stremio, …). That is the spec-complete fix for [Quattro] D-Bus idle inhibits are silently dropped since hypridle was replaced — screensaver fires during video playback (reproduced with Zen browser) #6475 and is complementary. This PR is the smaller, already-running-in-shell path that covers the reported Firefox/Zen cases without a new daemon.Test
bash test/shell.d/idle-test.sh— player matching,idleEnabledgating, and QML wiring../test/shell— idle file green. The same three omarchy-pkgs-checkout failures as onquattro(config-test.sh,snapper-test.sh,unowned-system-paths-test.sh);launch-about-test.sh,runtime-smoke-test.sh, andtheme-install-guards-test.shalso fail here on unmodifiedquattro(no compositor animation / live IPC / network).Live check on this machine: with Plex playing in windowed Firefox, idle status reports
mediaInhibiting: trueand the screensaver no longer starts.