Add support for KDE power management inhibition interface
Reported by
bajk...@googlemail.com,
Nov 22 2016
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36 Steps to reproduce the problem: Chromium should support KDE's DBus power management interface similar to how it supports GNOME's. KDE's power management interface supports a distinction between "keep screen on" and "just keep the machine running" like GNOME's has, which the Freedesktop one doesn't: org.kde.Solid.PowerManagement.PolicyAgent /org/kde/Solid/PowerManagement/PolicyAgent org.kde.Solid.PowerManagement.PolicyAgent.AddInhibition 5 "google-chrome" "Playing Video" org.kde.Solid.PowerManagement.PolicyAgent /org/kde/Solid/PowerManagement/PolicyAgent org.kde.Solid.PowerManagement.PolicyAgent.AddInhibition 1 "google-chrome" "Playing Audio" The first argument is an uint OR'd combination of 1 = Interrupt session (ie. suspend the machine) 2 = Obsolete 4 = Change screen settings (ie. brightness, turn screen off) The call returns a cookie uint that can be used to unset the inhibition again: org.kde.Solid.PowerManagement.PolicyAgent /org/kde/Solid/PowerManagement/PolicyAgent org.kde.Solid.PowerManagement.PolicyAgent.ReleaseInhibition 123 What is the expected behavior? What went wrong? Nothing, really, this is a feature request. Did this work before? N/A Chrome version: 54.0.2840.100 Channel: stable OS Version: Flash Version: Shockwave Flash 23.0 r0
,
Nov 22 2016
OS>Kernel>Power is for Chrome OS power management. This is a Linux request. Thanks for the description of the API! device/power_save_blocker/power_save_blocker_x11.cc is where this code lives.
,
Nov 22 2016
Why do we need a KDE specific one? Last time I checked, KDE supported the Free Desktop API. Power management works fine for me with KDE 4. https://cs.chromium.org/chromium/src/device/power_save_blocker/power_save_blocker_x11.cc?rcl=0&l=42 says: FREEDESKTOP_API, // Use the FreeDesktop API, for KDE4, KDE5, and XFCE.
,
Nov 22 2016
We don't *need* a KDE-specific one, it's just that KDE's is more versatile compared to the FDO one. This way we could allow the screen to sleep when just listening to music vs. keeping it on all the time as if we were watching a video. I can see that Chrome treats those inhibitions (I get both "Playing Audio" and "Playing Video") separately already.
,
Nov 22 2016
The code looks like it believes this distinction exists for fd.o:
void PowerSaveBlocker::Delegate::ApplyBlock() {
...
case FREEDESKTOP_API:
switch (type_) {
case kPowerSaveBlockPreventDisplaySleep:
object_proxy = bus_->GetObjectProxy(
kFreeDesktopAPIScreenServiceName,
dbus::ObjectPath(kFreeDesktopAPIScreenObjectPath));
method_call.reset(new dbus::MethodCall(
kFreeDesktopAPIScreenInterfaceName, "Inhibit"));
break;
case kPowerSaveBlockPreventAppSuspension:
object_proxy = bus_->GetObjectProxy(
kFreeDesktopAPIPowerServiceName,
dbus::ObjectPath(kFreeDesktopAPIPowerObjectPath));
method_call.reset(new dbus::MethodCall(
kFreeDesktopAPIPowerInterfaceName, "Inhibit"));
break;
}
On the other hand, https://www.freedesktop.org/wiki/Specifications/power-management-spec/ says "This is no longer supported in gnome-power-manager. This spec is considered obsolete." and all of the spec links are 404s. If KDE is the only desktop environment supporting the apparently-obsolete fd.o spec (I don't know if this is the case), maybe Chrome should implement the KDE spec rather than the fd.o one.
I guess I should mention that there's a systemd thing too: https://www.freedesktop.org/wiki/Software/systemd/inhibit/
,
Jan 2 2017
Deprecating UI>OSIntegration in favor of the more generic Internals>PlatformIntegration |
||||
►
Sign in to add a comment |
||||
Comment 1 by manoranj...@chromium.org
, Nov 22 2016Labels: M-56
Status: Untriaged (was: Unconfirmed)