mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-02-03 14:17:15 +08:00
kde-workspace patched for powerdevil systemd fixes
This commit is contained in:
parent
6336fd76df
commit
5f8d89ce19
@ -71,9 +71,9 @@ source=($_mirror/${pkgname}-$_kdever.tar.xz
|
||||
# fix kdm default user for greeter
|
||||
#fix_kdm_configdef.patch
|
||||
# "fix" some sytemsettings modules that need root access
|
||||
fix_root-only-kcms.patch)
|
||||
fix_root-only-kcms.patch
|
||||
# shutdown-fix.patch
|
||||
#sensors-fix.patch)
|
||||
systemd-inhibit.diff)
|
||||
|
||||
md5sums=(`grep ${pkgname}-$_kdever.tar.xz ../kde-sc.md5 | cut -d" " -f1`
|
||||
`grep kde-wallpapers-$_kdever.tar.xz ../kde-sc.md5 | cut -d" " -f1` # kde-wallpapers
|
||||
@ -98,8 +98,8 @@ md5sums=(`grep ${pkgname}-$_kdever.tar.xz ../kde-sc.md5 | cut -d" " -f1`
|
||||
#'db2d8166f5ea80ecd291deb9c0e2bb71' # fix_kdm-increase-xserver-timeout-bnc#462478.patch
|
||||
'814350c52c135d6f7bdada1e29223d38' # fix_terminate-server.patch
|
||||
#'97a5eb51e6f9d460f0d61bb322a1db5e' # fix_kdm_configdef.patch
|
||||
'5f963f80a026f0600edae1b1c70411e5') # fix_root-only-kcms.patch
|
||||
#'ecf3a9d6af9bdd3db0189e06ddf21034') # sensors-fix.patch
|
||||
'5f963f80a026f0600edae1b1c70411e5' # fix_root-only-kcms.patch
|
||||
'c10c55b880d6de129f85af0a701e6f4d') # systemd-inhibit.diff
|
||||
|
||||
#
|
||||
# build function
|
||||
@ -117,9 +117,10 @@ build() {
|
||||
|
||||
msg "applying fixes ..."
|
||||
#patch -Np0 -i ${srcdir}/fix_kdm-increase-xserver-timeout-bnc#462478.patch
|
||||
patch -Np0 -i ${srcdir}/fix_terminate-server.patch
|
||||
patch -p0 -i ${srcdir}/fix_terminate-server.patch
|
||||
#patch -p0 -N -i ${srcdir}/fix_kdm_configdef.patch
|
||||
patch -Np1 -i ${srcdir}/fix_root-only-kcms.patch
|
||||
patch -p1 -i ${srcdir}/fix_root-only-kcms.patch
|
||||
patch -p1 -i "${srcdir}"/systemd-inhibit.diff
|
||||
|
||||
msg "starting workspace build ..."
|
||||
cmake . -DCMAKE_BUILD_TYPE=${_build_type} \
|
||||
|
65
kde-workspace/systemd-inhibit.diff
Normal file
65
kde-workspace/systemd-inhibit.diff
Normal file
@ -0,0 +1,65 @@
|
||||
commit 29a65c6f984f3bcb5792b0b89061e45c925bbe7a
|
||||
Author: Lukas Tinkl <lukas@kde.org>
|
||||
Date: Fri Oct 5 11:57:13 2012 +0200
|
||||
|
||||
store the filedescriptor in a member variable
|
||||
|
||||
make systemd-inhibit work as intended, PowerDevil now handles
|
||||
power/sleep/lid buttons as intended
|
||||
|
||||
BUG: 307412
|
||||
|
||||
diff --git a/powerdevil/daemon/powerdevilpolicyagent.cpp b/powerdevil/daemon/powerdevilpolicyagent.cpp
|
||||
index efc3476..70588db 100644
|
||||
--- a/powerdevil/daemon/powerdevilpolicyagent.cpp
|
||||
+++ b/powerdevil/daemon/powerdevilpolicyagent.cpp
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <QtDBus/QDBusPendingReply>
|
||||
#include <QtDBus/QDBusConnectionInterface>
|
||||
#include <QtDBus/QDBusServiceWatcher>
|
||||
-#include <QtDBus/QDBusUnixFileDescriptor>
|
||||
|
||||
#include <KGlobal>
|
||||
#include <KDebug>
|
||||
@@ -225,6 +224,9 @@ void PolicyAgent::onSessionHandlerRegistered(const QString & serviceName)
|
||||
onActiveSessionChanged(m_activeSessionPath);
|
||||
|
||||
// inhibit systemd handling of power/sleep/lid buttons
|
||||
+ // http://www.freedesktop.org/wiki/Software/systemd/inhibit
|
||||
+ kDebug() << "fd passing available:" << bool(managerIface.connection().connectionCapabilities() & QDBusConnection::UnixFileDescriptorPassing);
|
||||
+
|
||||
QVariantList args;
|
||||
args << "handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch"; // what
|
||||
args << "PowerDevil"; // who
|
||||
@@ -232,8 +234,9 @@ void PolicyAgent::onSessionHandlerRegistered(const QString & serviceName)
|
||||
args << "block"; // mode
|
||||
QDBusPendingReply<QDBusUnixFileDescriptor> desc = managerIface.asyncCallWithArgumentList("Inhibit", args);
|
||||
desc.waitForFinished();
|
||||
- if (desc.isValid() && desc.value().isValid()) {
|
||||
- kDebug() << "systemd powersave events handling inhibited";
|
||||
+ if (desc.isValid()) {
|
||||
+ m_systemdInhibitFd = desc.value();
|
||||
+ kDebug() << "systemd powersave events handling inhibited, descriptor:" << m_systemdInhibitFd.fileDescriptor();
|
||||
}
|
||||
else
|
||||
kWarning() << "failed to inhibit systemd powersave handling";
|
||||
diff --git a/powerdevil/daemon/powerdevilpolicyagent.h b/powerdevil/daemon/powerdevilpolicyagent.h
|
||||
index 6001846..a046497 100644
|
||||
--- a/powerdevil/daemon/powerdevilpolicyagent.h
|
||||
+++ b/powerdevil/daemon/powerdevilpolicyagent.h
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <QtCore/QWeakPointer>
|
||||
|
||||
#include <QtDBus/QDBusContext>
|
||||
+#include <QtDBus/QDBusUnixFileDescriptor>
|
||||
|
||||
#include <kdemacros.h>
|
||||
|
||||
@@ -108,6 +109,7 @@ private:
|
||||
QString m_activeSessionPath;
|
||||
QWeakPointer< QDBusInterface > m_sdSessionInterface;
|
||||
QWeakPointer< QDBusInterface > m_sdSeatInterface;
|
||||
+ QDBusUnixFileDescriptor m_systemdInhibitFd;
|
||||
|
||||
// ConsoleKit support
|
||||
bool m_ckAvailable;
|
Loading…
Reference in New Issue
Block a user