[kde-workspace] hopefully also solve the screen dimming issue when inactive session goes idle

Lukas Tinkl ltinkl at fedoraproject.org
Thu Sep 13 15:56:48 UTC 2012


commit d8c0d929e38ff8b8437e0fb2b95276155827e712
Author: Lukas Tinkl <lukas at kde.org>
Date:   Thu Sep 13 17:56:38 2012 +0200

    hopefully also solve the screen dimming issue when inactive session goes idle

 kde-workspace.spec                   |    5 ++++-
 powerdevil-systemd-policyagent.patch |   29 ++++++++++++++++-------------
 2 files changed, 20 insertions(+), 14 deletions(-)
---
diff --git a/kde-workspace.spec b/kde-workspace.spec
index 3919535..aa0093a 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -11,7 +11,7 @@
 Summary: KDE Workspace
 Name:    kde-workspace
 Version: 4.9.1
-Release: 3%{?dist}
+Release: 4%{?dist}
 
 License: GPLv2
 URL:     https://projects.kde.org/projects/kde/kde-workspace
@@ -1005,6 +1005,9 @@ fi
 
 %changelog
 * Thu Sep 13 2012 Lukáš Tinkl <ltinkl at redhat.com> 4.9.1-3
+- hopefully also solve the screen dimming issue when inactive session goes idle
+
+* Thu Sep 13 2012 Lukáš Tinkl <ltinkl at redhat.com> 4.9.1-3
 - Resolves #849334 - screen lock failure (laptop lid)
 
 * Wed Sep 05 2012 Rex Dieter <rdieter at fedoraproject.org> 4.9.1-2
diff --git a/powerdevil-systemd-policyagent.patch b/powerdevil-systemd-policyagent.patch
index d2a5547..2f365c6 100644
--- a/powerdevil-systemd-policyagent.patch
+++ b/powerdevil-systemd-policyagent.patch
@@ -15,7 +15,7 @@ index 35a4fd4..033a0d5 100644
  set(powerdevil_bundled_actions_SRCS
      actions/bundled/suspendsession.cpp
 diff --git a/powerdevil/daemon/powerdevilpolicyagent.cpp b/powerdevil/daemon/powerdevilpolicyagent.cpp
-index 5ba595b..3d11b97 100644
+index 5ba595b..d2dbd73 100644
 --- a/powerdevil/daemon/powerdevilpolicyagent.cpp
 +++ b/powerdevil/daemon/powerdevilpolicyagent.cpp
 @@ -1,5 +1,6 @@
@@ -237,7 +237,7 @@ index 5ba595b..3d11b97 100644
          kDebug() << "Unable to connect to ActiveSessionChanged";
          m_ckAvailable = false;
          return;
-@@ -147,23 +284,44 @@ void PowerDevil::PolicyAgent::onConsoleKitRegistered(const QString& )
+@@ -147,23 +284,46 @@ void PowerDevil::PolicyAgent::onConsoleKitRegistered(const QString& )
      QDBusPendingReply< QDBusObjectPath > activeSession = QDBusConnection::systemBus().asyncCall(call);
      activeSession.waitForFinished();
  
@@ -262,11 +262,13 @@ index 5ba595b..3d11b97 100644
  
 -void PolicyAgent::onConsoleKitActiveSessionChanged(const QString& activeSession)
 +#ifdef POWERDEVIL_USE_SYSTEMD
-+void PolicyAgent::slotActiveSessionChanged(const QString & ifaceName, const QVariantMap & changedProps, const QStringList & /*invalidatedProps*/)
++void PolicyAgent::slotActiveSessionChanged(const QString & ifaceName, const QVariantMap & changedProps, const QStringList & invalidatedProps)
  {
 -    if (activeSession.isEmpty()) {
-+    if (ifaceName == SYSTEMD_LOGIN1_SEAT_IFACE && changedProps.keys().contains("ActiveSession")) {
-+        m_activeSessionPath = getNamedPathProperty(m_sdSeatInterface.data()->path(), SYSTEMD_LOGIN1_SEAT_IFACE, "ActiveSession");
++    const QString key = QLatin1String("ActiveSession");
++
++    if (ifaceName == SYSTEMD_LOGIN1_SEAT_IFACE && (changedProps.keys().contains(key) || invalidatedProps.contains(key))) {
++        m_activeSessionPath = getNamedPathProperty(m_sdSeatInterface.data()->path(), SYSTEMD_LOGIN1_SEAT_IFACE, key);
 +        kDebug() << "ACTIVE SESSION PATH CHANGED:" << m_activeSessionPath;
 +        onActiveSessionChanged(m_activeSessionPath);
 +    }
@@ -286,7 +288,7 @@ index 5ba595b..3d11b97 100644
          kDebug() << "Current session is now active";
          m_wasLastActiveSession = true;
      } else {
-@@ -201,6 +359,18 @@ PolicyAgent::RequiredPolicies PolicyAgent::unavailablePolicies()
+@@ -201,6 +361,18 @@ PolicyAgent::RequiredPolicies PolicyAgent::unavailablePolicies()
  
  PolicyAgent::RequiredPolicies PolicyAgent::requirePolicyCheck(PolicyAgent::RequiredPolicies policies)
  {
@@ -305,7 +307,7 @@ index 5ba595b..3d11b97 100644
      if (!m_ckAvailable) {
          // No way to determine if we are on the current session, simply suppose we are
          kDebug() << "Can't contact ck";
-@@ -212,6 +382,7 @@ PolicyAgent::RequiredPolicies PolicyAgent::requirePolicyCheck(PolicyAgent::Requi
+@@ -212,6 +384,7 @@ PolicyAgent::RequiredPolicies PolicyAgent::requirePolicyCheck(PolicyAgent::Requi
              return policies;
          }
      }
@@ -314,7 +316,7 @@ index 5ba595b..3d11b97 100644
      // Ok, let's go then
      RequiredPolicies retpolicies = None;
 diff --git a/powerdevil/daemon/powerdevilpolicyagent.h b/powerdevil/daemon/powerdevilpolicyagent.h
-index f637f1e..80dcba4 100644
+index f637f1e..4f0898e 100644
 --- a/powerdevil/daemon/powerdevilpolicyagent.h
 +++ b/powerdevil/daemon/powerdevilpolicyagent.h
 @@ -1,5 +1,6 @@
@@ -324,10 +326,11 @@ index f637f1e..80dcba4 100644
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -32,6 +33,13 @@
+@@ -32,6 +33,14 @@
  class QDBusServiceWatcher;
  class QDBusInterface;
  
++#define POWERDEVIL_USE_SYSTEMD 1
 +#define SYSTEMD_LOGIN1_SERVICE "org.freedesktop.login1"
 +#define SYSTEMD_LOGIN1_PATH "/org/freedesktop/login1"
 +#define SYSTEMD_LOGIN1_MANAGER_IFACE "org.freedesktop.login1.Manager"
@@ -338,7 +341,7 @@ index f637f1e..80dcba4 100644
  namespace PowerDevil
  {
  
-@@ -69,7 +77,6 @@ public Q_SLOTS:
+@@ -69,7 +78,6 @@ public Q_SLOTS:
      void ReleaseInhibition(uint cookie);
  
      void releaseAllInhibitions();
@@ -346,7 +349,7 @@ index f637f1e..80dcba4 100644
  Q_SIGNALS:
      void unavailablePoliciesChanged(PowerDevil::PolicyAgent::RequiredPolicies newpolicies);
  
-@@ -77,7 +84,11 @@ private Q_SLOTS:
+@@ -77,7 +85,11 @@ private Q_SLOTS:
      void onServiceUnregistered(const QString &serviceName);
      void onConsoleKitRegistered(const QString&);
      void onConsoleKitUnregistered(const QString&);
@@ -359,7 +362,7 @@ index f637f1e..80dcba4 100644
  
  private:
      explicit PolicyAgent(QObject* parent = 0);
-@@ -92,9 +103,17 @@ private:
+@@ -92,9 +104,17 @@ private:
      uint addInhibitionWithExplicitDBusService(uint types, const QString &appName,
                                                const QString &reason, const QString &service);
  
@@ -377,7 +380,7 @@ index f637f1e..80dcba4 100644
      bool m_sessionIsBeingInterrupted;
  
      QHash< uint, QPair< QString, QString > > m_cookieToAppName;
-@@ -104,7 +123,11 @@ private:
+@@ -104,7 +124,11 @@ private:
      uint m_lastCookie;
  
      QWeakPointer< QDBusServiceWatcher > m_busWatcher;


More information about the scm-commits mailing list