Keep the screensaver off while Firefox-family browsers play media - #8955
Open
michielvandermeer wants to merge 1 commit into
Open
Keep the screensaver off while Firefox-family browsers play media#8955michielvandermeer wants to merge 1 commit into
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.