New issue
Advanced search Search tips

Issue 667748 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Feature



Sign in to add a comment

Add support for KDE power management inhibition interface

Reported by bajk...@googlemail.com, Nov 22 2016

Issue description

UserAgent: 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
 
Components: OS>Kernel>Power
Labels: M-56
Status: Untriaged (was: Unconfirmed)

Comment 2 by derat@chromium.org, Nov 22 2016

Cc: thestig@chromium.org
Components: -OS>Kernel>Power UI>OSIntegration
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.
Cc: thomasanderson@chromium.org
Labels: -M-56
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.


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.

Comment 5 by derat@chromium.org, 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/
Components: -UI>OSIntegration Internals>PlatformIntegration
Deprecating UI>OSIntegration in favor of the more generic Internals>PlatformIntegration

Sign in to add a comment