Skip to content

Keep the screensaver off while Firefox-family browsers play media - #8955

Open
michielvandermeer wants to merge 1 commit into
omacom:quattrofrom
michielvandermeer:fix/firefox-media-idle-inhibit
Open

Keep the screensaver off while Firefox-family browsers play media#8955
michielvandermeer wants to merge 1 commit into
omacom:quattrofrom
michielvandermeer:fix/firefox-media-idle-inhibit

Conversation

@michielvandermeer

Copy link
Copy Markdown

Fixes #7220. Fixes #7199. Related to #6475.

What happens today

Quattro's idle service uses IdleMonitor { respectInhibitors: true }, which only honors Wayland zwp_idle_inhibit_manager_v1 inhibitors. Firefox, Zen, and LibreWolf request idle inhibit over the GTK portal / org.freedesktop.ScreenSaver while 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 clients showed inhibitingIdle: false while MPRIS PlaybackStatus was Playing. Tagging the window noidle (the existing idle_inhibit = always rule) immediately set inhibitingIdle: true.

What this does

  1. The idle service watches MPRIS. While a Firefox-family player reports Playing, it holds idle off the same way Stay Awake does — including cancelling an in-flight screensaver cycle. Pause/stop releases after 2s so a blip does not start the timer. Spotify, Chromium, and other players are left alone.
  2. Firefox-based browser windows also get idle_inhibit = fullscreen, so fullscreen video that never publishes MPRIS still holds idle off.
  3. idle toggle now flips stayAwake rather than the derived idleEnabled flag, 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

Test

  • bash test/shell.d/idle-test.sh — player matching, idleEnabled gating, and QML wiring.
  • ./test/shell — idle file green. The same three omarchy-pkgs-checkout failures as on quattro (config-test.sh, snapper-test.sh, unowned-system-paths-test.sh); launch-about-test.sh, runtime-smoke-test.sh, and theme-install-guards-test.sh also fail here on unmodified quattro (no compositor animation / live IPC / network).

Live check on this machine: with Plex playing in windowed Firefox, idle status reports mediaInhibiting: true and the screensaver no longer starts.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant