From: "Johannes Huber" <johu@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/kde:master commit in: kde-plasma/plasma-workspace/files/, kde-plasma/plasma-workspace/
Date: Sun, 16 Aug 2015 20:36:07 +0000 (UTC) [thread overview]
Message-ID: <1439756072.2e42a4bcc03207b3226d5bf229d297b353b8a511.johu@gentoo> (raw)
commit: 2e42a4bcc03207b3226d5bf229d297b353b8a511
Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Sun Aug 16 20:08:52 2015 +0000
Commit: Johannes Huber <johu <AT> gentoo <DOT> org>
CommitDate: Sun Aug 16 20:14:32 2015 +0000
URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=2e42a4bc
kde-plasma/plasma-workspace: Backport consolekit2 support
Package-Manager: portage-2.2.20.1
.../files/plasma-workspace-5.4-consolekit2.patch | 189 +++++++++++++++++++++
.../plasma-workspace-5.4.49.9999.ebuild | 5 +-
2 files changed, 193 insertions(+), 1 deletion(-)
diff --git a/kde-plasma/plasma-workspace/files/plasma-workspace-5.4-consolekit2.patch b/kde-plasma/plasma-workspace/files/plasma-workspace-5.4-consolekit2.patch
new file mode 100644
index 0000000..6131c90
--- /dev/null
+++ b/kde-plasma/plasma-workspace/files/plasma-workspace-5.4-consolekit2.patch
@@ -0,0 +1,189 @@
+From: Eric Koegel <eric.koegel@gmail.com>
+Date: Wed, 12 Aug 2015 08:33:39 +0000
+Subject: ConsoleKit2 support for screenlocker
+X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=72578284a1fda5f012cafcaccad6069fadbf9a25
+---
+ConsoleKit2 support for screenlocker
+
+ConsoleKit2 has the same API as systemd-logind for Lock, Unlock,
+PrepareForSleep, and Inhibit. This patch adds the functionality
+for ConsoleKit2 while attempting to minimize code duplication.
+
+REVIEW: 124469
+---
+
+
+--- a/ksmserver/screenlocker/logind.cpp
++++ b/ksmserver/screenlocker/logind.cpp
+@@ -25,13 +25,17 @@
+ #include <QDebug>
+ #include <QDBusConnection>
+ #include <QDBusConnectionInterface>
+-#include <QDBusPendingCallWatcher>
+ #include <QDBusServiceWatcher>
+
+ const static QString s_login1Service = QStringLiteral("org.freedesktop.login1");
+ const static QString s_login1Path = QStringLiteral("/org/freedesktop/login1");
+ const static QString s_login1ManagerInterface = QStringLiteral("org.freedesktop.login1.Manager");
+ const static QString s_login1SessionInterface = QStringLiteral("org.freedesktop.login1.Session");
++
++const static QString s_consolekitService = QStringLiteral("org.freedesktop.ConsoleKit");
++const static QString s_consolekitPath = QStringLiteral("/org/freedesktop/ConsoleKit/Manager");
++const static QString s_consolekitManagerInterface = QStringLiteral("org.freedesktop.ConsoleKit.Manager");
++const static QString s_consolekitSessionInterface = QStringLiteral("org.freedesktop.ConsoleKit.Session");
+
+ LogindIntegration::LogindIntegration(const QDBusConnection &connection, QObject *parent)
+ : QObject(parent)
+@@ -42,6 +46,10 @@
+ this))
+ , m_connected(false)
+ , m_inhibitFileDescriptor()
++ , m_service(nullptr)
++ , m_path(nullptr)
++ , m_managerInterface(nullptr)
++ , m_sessionInterface(nullptr)
+ {
+ connect(m_logindServiceWatcher, &QDBusServiceWatcher::serviceRegistered, this, &LogindIntegration::logindServiceRegistered);
+ connect(m_logindServiceWatcher, &QDBusServiceWatcher::serviceUnregistered, this,
+@@ -67,6 +75,11 @@
+ }
+ if (reply.value().contains(s_login1Service)) {
+ logindServiceRegistered();
++ // Don't register ck if we have logind
++ return;
++ }
++ if (reply.value().contains(s_consolekitService)) {
++ consolekitServiceRegistered();
+ }
+ }
+ );
+@@ -89,6 +102,40 @@
+ message.setArguments(QVariantList() << (quint32) QCoreApplication::applicationPid());
+ QDBusPendingReply<QDBusObjectPath> session = m_bus.asyncCall(message);
+ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
++
++ m_service = &s_login1Service;
++ m_path = &s_login1Path;
++ m_managerInterface = &s_login1ManagerInterface;
++ m_sessionInterface = &s_login1SessionInterface;
++
++ commonServiceRegistered(watcher);
++}
++
++void LogindIntegration::consolekitServiceRegistered()
++{
++ // Don't try to register with ck if we have logind
++ if (m_connected) {
++ return;
++ }
++
++ // get the current session
++ QDBusMessage message = QDBusMessage::createMethodCall(s_consolekitService,
++ s_consolekitPath,
++ s_consolekitManagerInterface,
++ QStringLiteral("GetCurrentSession"));
++ QDBusPendingReply<QDBusObjectPath> session = m_bus.asyncCall(message);
++ QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
++
++ m_service = &s_consolekitService;
++ m_path = &s_consolekitPath;
++ m_managerInterface = &s_consolekitManagerInterface;
++ m_sessionInterface = &s_consolekitSessionInterface;
++
++ commonServiceRegistered(watcher);
++}
++
++void LogindIntegration::commonServiceRegistered(QDBusPendingCallWatcher *watcher)
++{
+ connect(watcher, &QDBusPendingCallWatcher::finished, this,
+ [this](QDBusPendingCallWatcher *self) {
+ QDBusPendingReply<QDBusObjectPath> reply = *self;
+@@ -97,7 +144,7 @@
+ return;
+ }
+ if (!reply.isValid()) {
+- qDebug() << "The session is not registered with logind" << reply.error().message();
++ qDebug() << "The session is not registered: " << reply.error().message();
+ return;
+ }
+ const QString sessionPath = reply.value().path();
+@@ -105,15 +152,15 @@
+
+ // connections need to be done this way as the object exposes both method and signal
+ // with name "Lock"/"Unlock". Qt is not able to automatically handle this.
+- m_bus.connect(s_login1Service,
++ m_bus.connect(*m_service,
+ sessionPath,
+- s_login1SessionInterface,
++ *m_sessionInterface,
+ QStringLiteral("Lock"),
+ this,
+ SIGNAL(requestLock()));
+- m_bus.connect(s_login1Service,
++ m_bus.connect(*m_service,
+ sessionPath,
+- s_login1SessionInterface,
++ *m_sessionInterface,
+ QStringLiteral("Unlock"),
+ this,
+ SIGNAL(requestUnlock()));
+@@ -123,9 +170,9 @@
+ );
+
+ // connect to manager object's signals we need
+- m_bus.connect(s_login1Service,
+- s_login1Path,
+- s_login1ManagerInterface,
++ m_bus.connect(*m_service,
++ *m_path,
++ *m_managerInterface,
+ QStringLiteral("PrepareForSleep"),
+ this,
+ SIGNAL(prepareForSleep(bool)));
+@@ -136,9 +183,14 @@
+ if (m_inhibitFileDescriptor.isValid()) {
+ return;
+ }
+- QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service,
+- s_login1Path,
+- s_login1ManagerInterface,
++
++ if (!m_connected) {
++ return;
++ }
++
++ QDBusMessage message = QDBusMessage::createMethodCall(*m_service,
++ *m_path,
++ *m_managerInterface,
+ QStringLiteral("Inhibit"));
+ message.setArguments(QVariantList({QStringLiteral("sleep"),
+ i18n("Screen Locker"),
+
+--- a/ksmserver/screenlocker/logind.h
++++ b/ksmserver/screenlocker/logind.h
+@@ -23,6 +23,7 @@
+ #include <QDBusConnection>
+ #include <QDBusUnixFileDescriptor>
+ #include <QObject>
++#include <QDBusPendingCallWatcher>
+
+ class QDBusServiceWatcher;
+
+@@ -59,10 +60,16 @@
+ **/
+ explicit LogindIntegration(const QDBusConnection &connection, QObject *parent = nullptr);
+ void logindServiceRegistered();
++ void consolekitServiceRegistered();
++ void commonServiceRegistered(QDBusPendingCallWatcher *watcher);
+ QDBusConnection m_bus;
+ QDBusServiceWatcher *m_logindServiceWatcher;
+ bool m_connected;
+ QDBusUnixFileDescriptor m_inhibitFileDescriptor;
++ const QString *m_service;
++ const QString *m_path;
++ const QString *m_managerInterface;
++ const QString *m_sessionInterface;
+ };
+
+ #endif
+
diff --git a/kde-plasma/plasma-workspace/plasma-workspace-5.4.49.9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-5.4.49.9999.ebuild
index 7145c33..9af5106 100644
--- a/kde-plasma/plasma-workspace/plasma-workspace-5.4.49.9999.ebuild
+++ b/kde-plasma/plasma-workspace/plasma-workspace-5.4.49.9999.ebuild
@@ -122,7 +122,10 @@ DEPEND="${COMMON_DEPEND}
x11-proto/xproto
"
-PATCHES=( "${FILESDIR}/${PN}-5.4-startkde-script.patch" )
+PATCHES=(
+ "${FILESDIR}/${PN}-5.4-startkde-script.patch"
+ "${FILESDIR}/${PN}-5.4-consolekit2.patch"
+)
RESTRICT="test"
next reply other threads:[~2015-08-16 20:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-16 20:36 Johannes Huber [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-02-21 11:47 [gentoo-commits] proj/kde:master commit in: kde-plasma/plasma-workspace/files/, kde-plasma/plasma-workspace/ Andreas Sturmlechner
2021-11-09 13:04 Andreas Sturmlechner
2021-05-05 3:00 Andreas Sturmlechner
2021-05-04 21:12 Andreas Sturmlechner
2019-10-15 17:10 Andreas Sturmlechner
2019-05-14 6:28 Andreas Sturmlechner
2018-10-22 18:14 Andreas Sturmlechner
2016-11-12 8:34 Michael Palimaka
2016-10-08 15:51 Michael Palimaka
2016-03-20 14:47 Michael Palimaka
2015-12-28 0:33 Marc Schiffbauer
2015-11-14 16:01 Michael Palimaka
2015-11-10 12:41 Michael Palimaka
2015-07-04 14:48 Johannes Huber
2015-06-01 18:18 Michael Palimaka
2015-04-29 15:03 Michael Palimaka
2015-01-27 20:07 Johannes Huber
2015-01-21 20:48 Johannes Huber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1439756072.2e42a4bcc03207b3226d5bf229d297b353b8a511.johu@gentoo \
--to=johu@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox