org.freedesktop.PowerManagement.Inhibit should not inhibit screensaver locking
Submitted by Mike
Description
xfce4-power-manager currently inhibits the screensaver when org.freedesktop.PowerManagement.Inhibit.Inhibit has been called, but there's an entirely separate dbus call for inhibiting the screensaver (org.freedesktop.ScreenSaver) and that should be handled by the screensaver not the power-manager.
Chromium is (for the most part) correctly inhibiting power management while it's busy doing things in the background, other apps are doing this too, but from what I've seen none as often as Google-Chrome/Chromium. There's some reports with people saying that Chromium is doing so when it shouldn't be, while they might be right, it's still separate from the fact that screensaver inhibiting is a completely separate DBUS call.
For example, Chromium will send a DBUS call to both org.freedesktop.ScreenSaver.Inhibit and org.freedesktop.PowerManagement.Inhibit.Inhibit when playing a <video>
, but will call only org.freedesktop.PowerManagement.Inhibit.Inhibit when playing <audio>
or doing WebRTC in the background.
This to me seems like the correct behaviour, I don't want my screensaver triggering when I'm watching YouTube videos, but audio playing in the background and non-interactive WebRTC requests should probably still keep the system from going to sleep. Except that xfce4-power-manager is forcing the screensaver to stay awake even when ScreenSaver.Inhibit isn't being called.
I think this mostly means removing most of the xfpm_power_inhibit_changed_cb function in xfpm-power.c, I'm not confident enough in my C to make a patch myself though.
I'll admit it's debatable as to whether Chromium should be inhibiting so heavily for WebRTC and such, but that's a conversation for a different bug on their own bug tracker. Here's some related links/bugs with people talking about that which give some extra context for this issue:
https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1600622
https://forum.xfce.org/viewtopic.php?pid=44252
https://support.google.com/chrome/forum/AAAAP1KN0B0EZpNDL4GzyU/?hl=en&gpf=%23!topic%2Fchrome%2FEZpNDL4GzyU%3Bcontext-place%3Dforum%2Fchrome
https://unix.stackexchange.com/questions/451413/disabling-chromium-xfce-power-management-inhibition/451414
Version: 1.6.1