summaryrefslogtreecommitdiff
path: root/user/sddm/ck2-support.patch
blob: 8a9e6ee85c1e77c62a1a51ef2ee85f0a8aa1babb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff --git a/src/daemon/LogindDBusTypes.cpp b/src/daemon/LogindDBusTypes.cpp
index 79c7031..4ccfeb5 100644
--- a/src/daemon/LogindDBusTypes.cpp
+++ b/src/daemon/LogindDBusTypes.cpp
@@ -18,6 +18,7 @@ public:
     QString sessionIfaceName;
     QString seatIfaceName;
     QString userIfaceName;
+    QString newSeatSignalName;
 };
 
 LogindPathInternal::LogindPathInternal()
@@ -55,18 +56,20 @@ LogindPathInternal::LogindPathInternal()
         seatIfaceName = QStringLiteral("org.freedesktop.login1.Seat");
         sessionIfaceName = QStringLiteral("org.freedesktop.login1.Session");
         userIfaceName = QStringLiteral("org.freedesktop.login1.User");
+        newSeatSignalName = QStringLiteral("SeatNew");
         return;
     }
 
     if (QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral("org.freedesktop.ConsoleKit"))) {
-        qDebug() << "Console kit interface found";
+        qDebug() << "ConsoleKit interface found";
         available = true;
         serviceName = QStringLiteral("org.freedesktop.ConsoleKit");
         managerPath = QStringLiteral("/org/freedesktop/ConsoleKit/Manager");
-        managerIfaceName = QStringLiteral("/org.freedesktop.ConsoleKit.Manager"); //note this doesn't match logind
+        managerIfaceName = QStringLiteral("org.freedesktop.ConsoleKit.Manager"); //note this doesn't match logind
         seatIfaceName = QStringLiteral("org.freedesktop.ConsoleKit.Seat");
         sessionIfaceName = QStringLiteral("org.freedesktop.ConsoleKit.Session");
         userIfaceName = QStringLiteral("org.freedesktop.ConsoleKit.User");
+        newSeatSignalName = QStringLiteral("SeatAdded");
         return;
     }
     qDebug() << "No session manager found";
@@ -109,3 +112,8 @@ QString Logind::userIfaceName()
 {
     return s_instance->userIfaceName;
 }
+
+QString Logind::newSeatSignalName()
+{
+    return s_instance->newSeatSignalName;
+}
diff --git a/src/daemon/LogindDBusTypes.h b/src/daemon/LogindDBusTypes.h
index f1e8dd4..028879a 100644
--- a/src/daemon/LogindDBusTypes.h
+++ b/src/daemon/LogindDBusTypes.h
@@ -13,6 +13,7 @@ struct Logind
     static QString sessionIfaceName();
     static QString seatIfaceName();
     static QString userIfaceName();
+    static QString newSeatSignalName();
 };
 
 
diff --git a/src/daemon/SeatManager.cpp b/src/daemon/SeatManager.cpp
index c5afc57..6281ea8 100644
--- a/src/daemon/SeatManager.cpp
+++ b/src/daemon/SeatManager.cpp
@@ -26,6 +26,7 @@
 #include <QDBusMessage>
 #include <QDBusPendingReply>
 #include <QDBusContext>
+#include <QDebug>
 
 #include "LogindDBusTypes.h"
 
@@ -59,6 +60,12 @@ namespace SDDM {
         QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply);
         connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() {
             watcher->deleteLater();
+            if (Logind::serviceName().contains(QStringLiteral("ConsoleKit"))) {
+                m_canGraphical = true;
+                emit canGraphicalChanged(m_canGraphical);
+                return;
+            }
+
             if (!reply.isValid())
                 return;
 
@@ -113,7 +120,7 @@ namespace SDDM {
             }
         });
 
-        QDBusConnection::systemBus().connect(Logind::serviceName(), Logind::managerPath(), Logind::managerIfaceName(), QStringLiteral("SeatNew"), this, SLOT(logindSeatAdded(QString,QDBusObjectPath)));
+        QDBusConnection::systemBus().connect(Logind::serviceName(), Logind::managerPath(), Logind::managerIfaceName(), Logind::newSeatSignalName(), this, SLOT(logindSeatAdded(QString,QDBusObjectPath)));
         QDBusConnection::systemBus().connect(Logind::serviceName(), Logind::managerPath(), Logind::managerIfaceName(), QStringLiteral("SeatRemoved"), this, SLOT(logindSeatRemoved(QString,QDBusObjectPath)));
     }