[kde-workspace/f18] systemd-displaymanager respin and reading session information from login1 even for kdm
Martin Briza
mbriza at fedoraproject.org
Thu Apr 25 14:11:50 UTC 2013
commit 33f0e97a77b19f2b531689a5b6df9f09126ddcfd
Author: Martin Briza <mbriza at redhat.com>
Date: Thu Apr 25 16:09:34 2013 +0200
systemd-displaymanager respin and reading session information from login1 even for kdm
Resolves: #955374
...e-workspace-4.10.2-systemd-displaymanager.patch | 82 ++++++++++++++------
kde-workspace.spec | 11 ++-
2 files changed, 66 insertions(+), 27 deletions(-)
---
diff --git a/kde-workspace-4.9.3-systemd-displaymanager.patch b/kde-workspace-4.10.2-systemd-displaymanager.patch
similarity index 90%
rename from kde-workspace-4.9.3-systemd-displaymanager.patch
rename to kde-workspace-4.10.2-systemd-displaymanager.patch
index ee3f61e..5d93a28 100644
--- a/kde-workspace-4.9.3-systemd-displaymanager.patch
+++ b/kde-workspace-4.10.2-systemd-displaymanager.patch
@@ -1,5 +1,5 @@
---- libs/kworkspace/kdisplaymanager.cpp.systemd-displaymanager 2012-08-13 10:53:46.000000000 +0200
-+++ libs/kworkspace/kdisplaymanager.cpp 2012-12-05 12:58:32.193798795 +0100
+--- 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
@@ -40,6 +40,166 @@
#include <errno.h>
#include <stdio.h>
@@ -20,7 +20,7 @@
+#define _SYSTEMD_USER_PROPERTY "User"
+#define _SYSTEMD_SEAT_PROPERTY "Seat"
+#define _SYSTEMD_SESSIONS_PROPERTY "Sessions"
-+#define _SYSTEMD_SWITCH_CALL "Activate"
++#define _SYSTEMD_SWITCH_PROPERTY "Activate"
+
+#define SYSTEMD_SERVICE QLatin1String(_SYSTEMD_SERVICE)
+#define SYSTEMD_BASE_PATH QLatin1String(_SYSTEMD_BASE_PATH)
@@ -32,7 +32,7 @@
+#define SYSTEMD_USER_PROPERTY QLatin1String(_SYSTEMD_USER_PROPERTY)
+#define SYSTEMD_SEAT_PROPERTY QLatin1String(_SYSTEMD_SEAT_PROPERTY)
+#define SYSTEMD_SESSIONS_PROPERTY QLatin1String(_SYSTEMD_SESSIONS_PROPERTY)
-+#define SYSTEMD_SWITCH_CALL QLatin1String(_SYSTEMD_SWITCH_CALL)
++#define SYSTEMD_SWITCH_CALL QLatin1String(_SYSTEMD_SWITCH_PROPERTY)
+
+struct NamedDBusObjectPath
+{
@@ -195,17 +195,18 @@
};
class GDMFactory : public QDBusInterface
-@@ -131,6 +308,9 @@
- }
- switch (DMType) {
- default:
-+ qDBusRegisterMetaType<NamedDBusObjectPath>();
-+ qDBusRegisterMetaType<QList<NamedDBusObjectPath> >();
-+ qDBusRegisterMetaType<NumberedDBusObjectPath>();
- return;
- case NewKDM:
- case OldGDM:
-@@ -242,17 +422,31 @@
+@@ -115,6 +292,10 @@
+ const char *ptr;
+ struct sockaddr_un sa;
+
++ qDBusRegisterMetaType<NamedDBusObjectPath>();
++ qDBusRegisterMetaType<QList<NamedDBusObjectPath> >();
++ qDBusRegisterMetaType<NumberedDBusObjectPath>();
++
+ if (DMType == Dunno) {
+ if (!(dpy = ::getenv("DISPLAY")))
+ DMType = NoDM;
+@@ -242,17 +423,31 @@
static bool getCurrentSeat(QDBusObjectPath *currentSession, QDBusObjectPath *currentSeat)
{
@@ -246,7 +247,7 @@
}
}
}
-@@ -261,44 +455,44 @@
+@@ -261,44 +456,44 @@
static QList<QDBusObjectPath> getSessionsForSeat(const QDBusObjectPath &path)
{
@@ -265,7 +266,7 @@
+ QList<QDBusObjectPath> result;
+ foreach (const NamedDBusObjectPath &namedPath, r)
+ result.append(namedPath.path);
-+ // This pretty much can't contain any other than local sessions as seats are assigned only locally in systemd
++ // This pretty much can't contain any other than local sessions as the seat is retrieved from the current session
+ return result;
+ }
+ }
@@ -318,7 +319,7 @@
}
if (DMType == OldKDM)
-@@ -329,9 +523,21 @@
+@@ -329,9 +524,21 @@
return;
if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
@@ -343,7 +344,7 @@
return;
}
-@@ -406,9 +612,15 @@
+@@ -406,9 +613,15 @@
if (DMType == NewGDM || DMType == LightDM) {
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
@@ -362,8 +363,13 @@
if (r.isValid())
return r.value();
}
-@@ -468,23 +680,56 @@
- if (DMType == NewGDM || DMType == LightDM) {
+@@ -465,26 +678,61 @@
+ if (DMType == OldKDM)
+ return false;
+
+- if (DMType == NewGDM || DMType == LightDM) {
++ // FIXME TODO WARNING HACK beware of this workaround, will get rid of it in a few days (if it's not spring 2013 and this line is still here, please smack mbriza-at-redhat-dot-com)
++ if (DMType != OldGDM) {
QDBusObjectPath currentSession, currentSeat;
if (getCurrentSeat(¤tSession, ¤tSeat)) {
- foreach (const QDBusObjectPath &sp, getSessionsForSeat(currentSeat)) {
@@ -387,7 +393,8 @@
+ SessEnt se;
+ lsess.getSessionLocation(se);
+ if ((lsess.property("Class").toString() != QLatin1String("greeter")) &&
-+ (lsess.property("State").toString() != QLatin1String("closing"))) {
++ (lsess.property("State").toString() == QLatin1String("online") ||
++ lsess.property("State").toString() == QLatin1String("active"))) {
+ NumberedDBusObjectPath numberedPath = lsess.getUser();
+ se.display = lsess.property("Display").toString();
+ se.vt = lsess.property("VTNr").toInt();
@@ -402,7 +409,7 @@
+ se.tty = !lsess.property("TTY").toString().isEmpty();
+ }
+ list.append(se);
-+ }
++ }
+ }
+ }
+ // ConsoleKit part
@@ -433,7 +440,29 @@
return true;
}
return false;
-@@ -566,16 +811,33 @@
+@@ -507,21 +755,6 @@
+ se.tty = false;
+ list.append(se);
+ }
+- } else {
+- if (!exec("list\talllocal\n", re))
+- return false;
+- const QStringList sess = QString(re.data() + 3).split(QChar('\t'), QString::SkipEmptyParts);
+- for (QStringList::ConstIterator it = sess.constBegin(); it != sess.constEnd(); ++it) {
+- QStringList ts = (*it).split(QChar(','));
+- SessEnt se;
+- se.display = ts[0];
+- se.vt = ts[1].mid(2).toInt();
+- se.user = ts[2];
+- se.session = ts[3];
+- se.self = (ts[4].indexOf('*') >= 0);
+- se.tty = (ts[4].indexOf('t') >= 0);
+- list.append(se);
+- }
+ }
+ return true;
+ }
+@@ -566,16 +799,33 @@
if (DMType == NewGDM || DMType == LightDM) {
QDBusObjectPath currentSeat;
if (getCurrentSeat(0, ¤tSeat)) {
@@ -477,3 +506,8 @@
}
}
}
+@@ -643,3 +893,4 @@
+ }
+
+ #endif // Q_WS_X11
++
diff --git a/kde-workspace.spec b/kde-workspace.spec
index edf3fb4..ac9b642 100644
--- a/kde-workspace.spec
+++ b/kde-workspace.spec
@@ -17,7 +17,7 @@
Summary: KDE Workspace
Name: kde-workspace
Version: 4.10.2
-Release: 8%{?dist}
+Release: 9%{?dist}
License: GPLv2
URL: https://projects.kde.org/projects/kde/kde-workspace
@@ -103,7 +103,8 @@ Patch57: kde-workspace-4.8.0-bug796969.patch
# merged patches: systemd-switch-user{,2} systemd-shutdown
# Support for systemd AND ConsoleKit in kworkspace
-Patch62: kde-workspace-4.9.3-systemd-displaymanager.patch
+# contains a small hack, to be fixed properly soon
+Patch62: kde-workspace-4.10.2-systemd-displaymanager.patch
## upstream patches
Patch103: 0003-Allow-Rich-Text-in-QML-notifications-plasmoid-Allow-.patch
@@ -468,7 +469,7 @@ Requires: akonadi
%patch53 -p1 -b .kdm_xauth
%patch55 -p1 -b .BUILD_KCM_RANDR
%patch57 -p1 -b .bug796969
-%patch62 -p0 -b .systemd-displaymanager
+%patch62 -p1 -b .systemd-displaymanager
# upstream patches
%patch103 -p1 -b .0003
@@ -1035,6 +1036,10 @@ fi
%changelog
+* 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
+
* Wed Apr 24 2013 Rex Dieter <rdieter at fedoraproject.org> 4.10.2-8
- avoid/revert commit to avoid plasma crash on wallpaper change (kde#318806)
More information about the scm-commits
mailing list