[kde-workspace/f18] changed the systemd-displaymanager patch to switch the sessions using systemd-logind, too

Martin Briza mbriza at fedoraproject.org
Mon Apr 29 15:55:11 UTC 2013


commit 1ec073c0abfc37ca941bd7546fa7850f7c4d6e49
Author: Martin Briza <mbriza at redhat.com>
Date:   Mon Apr 29 16:00:22 2013 +0200

    changed the systemd-displaymanager patch to switch the sessions using systemd-logind, too

 kde-workspace-4.10.2-systemd-displaymanager.patch |   94 +++++++++++----------
 kde-workspace.spec                                |    5 +-
 2 files changed, 54 insertions(+), 45 deletions(-)
---
diff --git a/kde-workspace-4.10.2-systemd-displaymanager.patch b/kde-workspace-4.10.2-systemd-displaymanager.patch
index 5d93a28..7c5bdb8 100644
--- a/kde-workspace-4.10.2-systemd-displaymanager.patch
+++ b/kde-workspace-4.10.2-systemd-displaymanager.patch
@@ -1,5 +1,5 @@
---- a/libs/kworkspace/kdisplaymanager.cpp	2013-03-01 07:32:25.116846223 +0100
-+++ b/libs/kworkspace/kdisplaymanager.cpp	2013-04-25 15:22:19.749417953 +0200
+--- kde-workspace-4.10.2/libs/kworkspace/kdisplaymanager.cpp.systemd-displaymanager	2013-03-01 07:32:25.116846223 +0100
++++ kde-workspace-4.10.2/libs/kworkspace/kdisplaymanager.cpp	2013-04-29 14:45:05.406859931 +0200
 @@ -40,6 +40,166 @@
  #include <errno.h>
  #include <stdio.h>
@@ -462,52 +462,58 @@
      }
      return true;
  }
-@@ -566,16 +799,33 @@
-     if (DMType == NewGDM || DMType == LightDM) {
-         QDBusObjectPath currentSeat;
-         if (getCurrentSeat(0, &currentSeat)) {
--            foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
--                CKSession lsess(sp);
--                if (lsess.isValid()) {
--                    SessEnt se;
--                    getSessionLocation(lsess, se);
--                    if (se.vt == vt) {
--                        if (se.tty) // ConsoleKit simply ignores these
--                            return false;
--                        lsess.call(QLatin1String("Activate"));
--                        return true;
-+            // systemd part // preferred
-+            if (QDBusConnection::systemBus().interface()->isServiceRegistered(SYSTEMD_SERVICE)) {
-+                foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
-+                    SystemdSession lsess(sp);
-+                    if (lsess.isValid()) {
-+                        SessEnt se;
-+                        lsess.getSessionLocation(se);
-+                        if (se.vt == vt) {
-+                            lsess.call(SYSTEMD_SWITCH_CALL);
-+                            return true;
-+                        }
+@@ -563,14 +796,35 @@
+ bool
+ KDisplayManager::switchVT(int vt)
+ {
+-    if (DMType == NewGDM || DMType == LightDM) {
+-        QDBusObjectPath currentSeat;
+-        if (getCurrentSeat(0, &currentSeat)) {
++    if (DMType == OldKDM)
++        return exec(QString("activate\tvt%1\n").arg(vt).toLatin1());
++
++    if (DMType == OldGDM)
++        return exec(QString("SET_VT %1\n").arg(vt).toLatin1());
++
++    QDBusObjectPath currentSeat;
++    if (getCurrentSeat(0, &currentSeat)) {
++        // systemd part // preferred
++        if (QDBusConnection::systemBus().interface()->isServiceRegistered(SYSTEMD_SERVICE)) {
++            foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
++                SystemdSession lsess(sp);
++                if (lsess.isValid()) {
++                    SessEnt se;
++                    lsess.getSessionLocation(se);
++                    if (se.vt == vt) {
++                        lsess.call(SYSTEMD_SWITCH_CALL);
++                        return true;
 +                    }
 +                }
 +            }
-+            // ConsoleKit part
-+            else if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.freedesktop.ConsoleKit")) {
-+                foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
-+                    CKSession lsess(sp);
-+                    if (lsess.isValid()) {
-+                        SessEnt se;
-+                        lsess.getSessionLocation(se);
-+                        if (se.vt == vt) {
-+                            if (se.tty) // ConsoleKit simply ignores these
-+                                return false;
-+                            lsess.call(QLatin1String("Activate"));
-+                            return true;
-+                        }
-                     }
++        }
++        // ConsoleKit part
++        else if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.freedesktop.ConsoleKit")) {
+             foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
+                 CKSession lsess(sp);
+                 if (lsess.isValid()) {
+                     SessEnt se;
+-                    getSessionLocation(lsess, se);
++                    lsess.getSessionLocation(se);
+                     if (se.vt == vt) {
+                         if (se.tty) // ConsoleKit simply ignores these
+                             return false;
+@@ -580,13 +834,8 @@
                  }
              }
-@@ -643,3 +893,4 @@
+         }
+-        return false;
+     }
+-
+-    if (DMType == OldGDM)
+-        return exec(QString("SET_VT %1\n").arg(vt).toLatin1());
+-
+-    return exec(QString("activate\tvt%1\n").arg(vt).toLatin1());
++    return false;
  }
  
- #endif // Q_WS_X11
-+
+ void
diff --git a/kde-workspace.spec b/kde-workspace.spec
index ac9b642..0dbf672 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -17,7 +17,7 @@
 Summary: KDE Workspace
 Name:    kde-workspace
 Version: 4.10.2
-Release: 9%{?dist}
+Release: 10%{?dist}
 
 License: GPLv2
 URL:     https://projects.kde.org/projects/kde/kde-workspace
@@ -1036,6 +1036,9 @@ fi
 
 
 %changelog
+* Mon Apr 29 2013 Martin Briza <mbriza at redhat.com> 4.10.2-10
+- changed the systemd-displaymanager patch to switch the sessions using systemd-logind, too
+
 * Thu Apr 25 2013 Martin Briza <mbriza at redhat.com> 4.10.2-9
 - regenerated the systemd-displaymanager patch against latest upstream master
 - worked around #955374 before I fix it clean upstream


More information about the scm-commits mailing list