Closed Bug 1896235 Opened 5 months ago Closed 2 months ago

Idle inhibitor breaks when separating tab to a new window

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 125
defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: adamnejm, Assigned: stransky)

References

(Regressed 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

Steps to reproduce:

Firefox disables the idle inhibitor when detaching a tab with playing media to a new window.

  1. Launch Firefox (MOZ_ENABLE_WAYLAND=1 MOZ_LOG="LinuxWakeLock:5" firefox)
  2. Open a second tab and load YouTube
  3. Play a video - idle inhibitor will correctly kick in
  4. Using mouse, drag the tab - detaching it and creating a new window
  5. Idle inhibitor is removed

System: ArchLinux
Kernel: 6.8.9-arch1-2
Firefox: Mozilla Firefox 125.0.3 (package version: 125.0.3-2)
Windowing: Wayland
Desktop: Hyprland v0.40.0-55-g38911d6d

Actual results:

Idle inhibitor gets disabled when detaching tab with media . Logs displayed after performing step 4:

[Parent 11692: Main Thread]: D/LinuxWakeLock [737296287ac0] WakeLockListener topic video-playing state unlocked request lock 0
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::UninhibitScreensaver() Inhibited 1
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopPortal
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::UninhibitFreeDesktopPortal() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0 object path: /org/freedesktop/portal/desktop/request/1_171/t/831169027
[Parent 11692: Main Thread]: D/LinuxWakeLock [737296287ac0] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::InhibitScreensaver() Inhibited 1
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::DBusUninhibitSucceeded() mShouldInhibit 0
[Parent 11692: Main Thread]: D/LinuxWakeLock [73726ffbc6a0] WakeLockTopic::UninhibitFreeDesktopPortal() Inhibit removed

Expected results:

The idle inhibitor should remained turned on.

I don't think this is a problem with window occlusion (detecting if the Firefox is not visible), as opening and closing a new tab on the detached window will fix the inhibitor.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

That's interesting, thanks.

Flags: needinfo?(stransky)
Priority: -- → P3

Yes, looks like the we fail to process more events together:

-> Request to enable wake lock
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1ea137ea60] WakeLockListener topic video-playing state unlocked request lock 0
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::UninhibitScreensaver() Inhibited 1
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopScreensaver

-> Call uninhibit
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] UninhibitFreeDesktopScreensaver()
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::DBusUninhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0 request id 412117891

-> Request to inhibit while waiting to DBus from uninhibit request
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1ea137ea60] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::InhibitScreensaver() Inhibited 1

-> Finished uninhibit request, inhibit is discarded
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::DBusUninhibitScreensaver() proxy created
[Parent 78708: Main Thread]: D/LinuxWakeLock [7f1e8792f060] WakeLockTopic::DBusUninhibitSucceeded() mShouldInhibit 0
Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/1830fda145b5 [Linux] Use different GCancellable for inhibit/uninhibit requests r=emilio https://hg.mozilla.org/integration/autoland/rev/0e96a2dfdd8c [Linux] Replace mInhibited and mShouldInhibit flags with enum type to track wake lock state r=emilio
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
Regressions: 1914418
Regressions: 1917548
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: