Open Bug 1766064 Opened 2 years ago Updated 3 days ago

Firefox inhibits xscreensaver but not DPMS

Categories

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

Firefox 99
defect

Tracking

()

Tracking Status
firefox107 --- affected

People

(Reporter: sashaa, Unassigned)

References

Details

Steps to reproduce:

Enable xscreensaver and its power management settings (DPMS).

Actual results:

When watching video in Firefox, screensaver is inhibited as expected but screen still turns off.

Expected results:

Screensaver and screen going to sleep should both be inhibited while video is playing.

So this also happens if I set DPMS with xset without any other power manager or screensaver active.

Summary: Firefox inhibits xscreensaver but not its power management → Firefox inhibits xscreensaver but not DPMS
Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Which desktop is that?
Thanks.

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

(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)

Which desktop is that?
Thanks.

MATE 1.26.0

Flags: needinfo?(sashaa)

The wake lock code is here:

https://searchfox.org/mozilla-central/source/widget/gtk/WakeLockListener.cpp#55

I wonder which one of the WakeLockDesktopEnvironment is the correct one for MATE.

Hello! I have managed to reproduce the issue with firefox 107.0a1(2022-10-13) on Ubuntu 22.04. I will mark this issue as NEW.

Thank you!

Status: UNCONFIRMED → NEW
Ever confirmed: true

Hello,

Could this affect the current ESR (102.10.0) version as well?
I started having issues similar to this after upgrading to Debian 12 (bookworm).

I am using an xmonad based minimalistic desktop (with EWMH extensions) and xscreensaver as a screensaver.

Regards,
János Pásztor

Hello, I am also having this issue.

  • EndeavourOS Linux x86_64: 6.8.5-arch1-1
  • WM: i3 with exec --no-startup-id xset s 480 dpms 600 600 600
  • Firefox 124.0.2

Can you run Firefox on terminal with MOZ_LOG="LinuxWakeLock:5" env variable and attach the log here?
Thanks.

Flags: needinfo?(j.vormschlag)

(In reply to Martin Stránský [:stransky] (ni? me) from comment #8)

Can you run Firefox on terminal with MOZ_LOG="LinuxWakeLock:5" env variable and attach the log here?
Thanks.

just for testing, I set screensaver to xset s 20 dpms 30 30 30. Here's the output of xset q:

Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000000
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
    06: Suspend:     off    07: Mute:        off    08: Misc:        off
    09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
    12: Group 2:     off    13: Mouse Keys:  off
  auto repeat delay:  660    repeat rate:  25
  auto repeating keys:  00ffffffdffffbbf
                        fadfffefffedffff
                        9fffffffffffffff
                        fff7ffffffffffff
  bell percent:  50    bell pitch:  400    bell duration:  100
Pointer Control:
  acceleration:  2/1    threshold:  4
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  20    cycle:  600
Colors:
  default colormap:  0x22    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  built-ins
DPMS (Display Power Management Signaling):
  Standby: 30    Suspend: 30    Off: 30
  DPMS is Enabled
  Monitor is On

Here is the log I collected by running firefox with firefox --MOZ_LOG="LinuxWakeLock:5" --MOZ_LOG_FILE=240415_firefox:

[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::WakeLockTopic() created video-playing
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40]   switched to WakeLockType FreeDesktopScreensaver
[Parent 86303: Main Thread]: D/LinuxWakeLock [7617269ac880] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::InhibitScreensaver() Inhibited 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] InhibitFreeDesktopScreensaver()
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitFailed(1)
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40]   switched to WakeLockType FreeDesktopPower
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] InhibitFreeDesktopPower()
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitFailed(1)
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopPower
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40]   switched to WakeLockType FreeDesktopPortal
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPortal
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::InhibitFreeDesktopPortal() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::InhibitFreeDesktopPortal(): inhibited, objpath to unihibit: /org/freedesktop/portal/desktop/request/1_7736/t
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusInhibitSucceeded(), mInhibitRequestID 0 mShouldInhibit 1
[Parent 86303: Main Thread]: D/LinuxWakeLock [7617269ac880] WakeLockListener topic video-playing state locked-background request lock 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::UninhibitScreensaver() Inhibited 1
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopPortal
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::UninhibitFreeDesktopPortal() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0 object path: /org/freedesktop/portal/desktop/request/1_7736/t
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::DBusUninhibitSucceeded() mShouldInhibit 0
[Parent 86303: Main Thread]: D/LinuxWakeLock [76170bc5fc40] WakeLockTopic::UninhibitFreeDesktopPortal() Inhibit removed
[Parent 86303: Main Thread]: D/LinuxWakeLock [7617269ac880] Wake⏎   

let me know if I can help any further. Thanks!

Flags: needinfo?(j.vormschlag)

I am experiencing this in Ubuntu 22.04 and Firefox 124.0.2 (with Fluxbox as the window manager). I first noticed the issue after upgrading from 20.04 to 22.04.

Flags: needinfo?(stransky)

Apologies; I have run the debugging step to generate a log as suggested above, and it looks like my issue is slightly different. I also see failures to inhibit the screensaver and power management, but the underlying DBus errors are different. It looks like my minimal setup may not have the required services installed / running. I disable the screensaver entirely with xset, which may be masking the screensaver inhibition failure.

Log output:

[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::WakeLockTopic() created video-playing
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType Initial
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0]   switched to WakeLockType FreeDesktopScreensaver
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbbd1679a90] WakeLockListener topic video-playing state locked-foreground request lock 1
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::InhibitScreensaver() Inhibited 0
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopScreensaver
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] InhibitFreeDesktopScreensaver()
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ScreenSaver was not provided by any .service files
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitFailed(1)
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopScreensaver
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0]   switched to WakeLockType FreeDesktopPower
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPower
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] InhibitFreeDesktopPower()
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitScreensaver() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitScreensaver() proxy created
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitFailed() Inhibit call failed : GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PowerManagement was not provided by any .service files
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitFailed(1)
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SwitchToNextWakeLockType() WakeLockType FreeDesktopPower
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0]   switched to WakeLockType FreeDesktopPortal
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SendInhibit() WakeLockType FreeDesktopPortal
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::InhibitFreeDesktopPortal() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::InhibitFreeDesktopPortal(): inhibited, objpath to unihibit: /org/freedesktop/portal/desktop/request/1_381/t
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusInhibitSucceeded(), mInhibitRequestID 0 mShouldInhibit 1
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbbd1679a90] WakeLockListener topic video-playing state unlocked request lock 0
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::UninhibitScreensaver() Inhibited 1
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::SendUninhibit() WakeLockType FreeDesktopPortal
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::UninhibitFreeDesktopPortal() mWaitingForDBusInhibit 0 mWaitingForDBusUninhibit 0 object path: /org/freedesktop/portal/desktop/request/1_381/t
[Parent 3285996: Main Thread]: D/LinuxWakeLock [7fbb899c63d0] WakeLockTopic::DBusUninhibitSucceeded() mShouldInhibit 0
[Parent 3285996: Main Thread]: D/Li

xset -q output:

Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000000
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
    06: Suspend:     off    07: Mute:        off    08: Misc:        off
    09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
    12: Group 2:     off    13: Mouse Keys:  off
  auto repeat delay:  660    repeat rate:  25
  auto repeating keys:  00ffffffdffffbbf
                        fadfffefffedffff
                        9fffffffffffffff
                        fff7ffffffffffff
  bell percent:  50    bell pitch:  400    bell duration:  100
Pointer Control:
  acceleration:  2/1    threshold:  4
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  0    cycle:  0
Colors:
  default colormap:  0x20    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Enabled
  Monitor is On

I have confirmed that installing xfce4-power-manager (which implements the org.freedesktop.PowerManagement interface; correctly since 4.17, apparently) resolves my issue (I could probably find or write a more bare-bones solution, but it seems pretty lightweight).

I don't know if Firefox should be doing something here in addition to what it's already attempting, but I have a solution for my specific setup.

I also face the same issue with Firefox 125.0.3. I'm using Xorg and i3 window manager. I'd be happy to provide logs or more info if it can help fix the problem.

This discussion is probably outside the scope of this bug, but on the basis of the previous messages in this thread I suspect that most people encountering this problem are running some kind of minimalist alternative desktop environment, and don't have a component installed which correctly implements the DBus interfaces that Firefox tries to use to inhibit power management (my understanding is that there are many different desktop-specific legacy interfaces, newer generic Freedesktop interfaces which are not yet universally adopted, and multiple other ways to interact with power management settings, so this is kind of a mess at the moment).

Since my last comment, I removed xfce4-power-manager as well as gnome-screensaver and replaced them both with powerkit, which is designed to be a minimalist power manager for alternative desktops. I can confirm that it implements these interfaces correctly, and you can configure it to show notifications when power management is inhibited, which is useful for debugging. So I would recommend trying this first if you have the same issue.

(In reply to adrianna.pinska from comment #14)

This discussion is probably outside the scope of this bug, but on the basis of the previous messages in this thread I suspect that most people encountering this problem are running some kind of minimalist alternative desktop environment, and don't have a component installed which correctly implements the DBus interfaces that Firefox tries to use to inhibit power management (my understanding is that there are many different desktop-specific legacy interfaces, newer generic Freedesktop interfaces which are not yet universally adopted, and muThanks for your ltiple other ways to interact with power management settings, so this is kind of a mess at the moment).

Since my last comment, I removed xfce4-power-manager as well as gnome-screensaver and replaced them both with powerkit, which is designed to be a minimalist power manager for alternative desktops. I can confirm that it implements these interfaces correctly, and you can configure it to show notifications when power management is inhibited, which is useful for debugging. So I would recommend trying this first if you have the same issue.

Thanks for your help. Unfortunately, powerkit did not solve my problem. Powerkit correctly notifies me when it recognizes firefox playing a video. It shows me a notification saying "New screen inhibitor (video playing)". However dpms is still triggered after the stipulated time period set by xset. I am not sure whether this is firefox's fault or it is because I am not correctly implementing some Dbus interfaces.

(In reply to ashdeopurkar from comment #15)

Thanks for your help. Unfortunately, powerkit did not solve my problem. Powerkit correctly notifies me when it recognizes firefox playing a video. It shows me a notification saying "New screen inhibitor (video playing)". However dpms is still triggered after the stipulated time period set by xset. I am not sure whether this is firefox's fault or it is because I am not correctly implementing some Dbus interfaces.

I wonder if this is because there's a competing power manager running which is doing its own thing independently and clashing with what powerkit is doing. I think that it probably isn't Firefox's fault -- Firefox is using the generic interfaces which I believe are the "most correct".

Flags: needinfo?(stransky)
See Also: → 1882641
Flags: needinfo?(stransky)
Flags: needinfo?(stransky)

(In reply to adrianna.pinska from comment #16)

I wonder if this is because there's a competing power manager running which is doing its own thing independently and clashing with what powerkit is doing. I think that it probably isn't Firefox's fault -- Firefox is using the generic interfaces which I believe are the "most correct".

So this one can be closed, right?
Thanks.

I can reproduce this on Arch Linux on Gnome (running in Wayland).
Is Wayland a different bug?

I'm not aware of any other interface Firefox can use to inhibit DPMS. We use what's available.

You need to log in before you can comment on or make changes to this bug.