Closed Bug 2057365 Opened 3 months ago Closed 3 months ago

Firefox prevent Linux from sleep/suspend

Categories

(Core :: Widget: Gtk, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
relnote-firefox --- 155+
firefox155 --- fixed

People

(Reporter: sinker, Assigned: sinker)

Details

Attachments

(1 external file)

After using firefox for a period of time, it will prevent the device from sleep or suspend.
When it happen, Firefox holds a inhibitor.

$ gnome-session-inhibit --list
firefox: Playing video (suspend)

And, there is no any tab playing video.

Severity: -- → S3

More details!

Some service may play muted video. Firefox will show an indicator when a tab is playing audio. However, it doesn't show any indicator for video without audio channel or muted. And, on linux, video playback would cause wakelock to prevent the system from sleeping or suspend, even the owner doc is in background. Without any indicator, doesn't know what block the system from sleeping.

GTK is the only backend that does this: macOS/Windows/Android release the video lock once backgrounded (foreground video only blocks the display, never system sleep).

Suggested fix: release the video lock once backgrounded, and keep video-playing idle for foreground, matching the other platforms; audible background playback is already handled by the separate audio-playing topic.

A muted autoplay video in a background tab or subframe still takes the
"video-playing" wake lock, because that lock is gated on the presence of an
audio track rather than on being audible. GTK then escalated a backgrounded
video lock to a GNOME SUSPEND inhibitor, blocking system sleep with no
user-visible signal (the tab shows no sound indicator).

GTK was the only backend doing this: macOS, Windows and Android all release
the video lock once it is backgrounded. Genuinely audible background playback
is covered by the separate "audio-playing" topic, so a backgrounded
video-playing lock should hold no inhibitor at all.

Release both the foreground (IDLE) and background (SUSPEND) inhibitors when a
video-playing lock goes to locked-background. Foreground video still holds an
IDLE inhibitor to keep the display awake.

Assignee: nobody → thinker.li
Status: NEW → ASSIGNED
Pushed by thinker.li@gmail.com: https://github.com/mozilla-firefox/firefox/commit/c2b3867edf5a https://hg.mozilla.org/integration/autoland/rev/885b53420b21 Don't hold a suspend inhibitor for a backgrounded video-playing wake lock on GTK r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

Did you want to nominate this for the Fx155 relnotes? Possible wording:

Fixed Firefox preventing Linux systems from sleeping or suspending after a long browsing session

Flags: needinfo?(thinker.li)

Release Note Request (optional, but appreciated)
[Why is this notable]: This is long existing bug that Linux users are frustrated and difficult to figure out the root cause.
[Affects Firefox for Android]: No
[Suggested wording]:
Fixed Firefox preventing Linux systems from sleeping or suspending after a long browsing session
[Links (documentation, blog post, etc)]:

relnote-firefox: --- → ?
Flags: needinfo?(thinker.li)

Added to the Fx155 relnotes.

QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: