Fix kwin quit

pull/15/head
reionwong 5 years ago
parent 3941ac1437
commit 34f87f164a

39
debian/postinst vendored

@ -0,0 +1,39 @@
#! /bin/sh
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
case "$1" in
configure)
update-alternatives --install /usr/bin/x-session-manager \
x-session-manager /usr/bin/cutefish-session 60
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

41
debian/prerm vendored

@ -0,0 +1,41 @@
#! /bin/sh
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove)
update-alternatives --remove x-session-manager /usr/bin/cutefish-session
;;
upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

@ -31,6 +31,7 @@
#include <QDir>
#include <QDBusInterface>
#include <QDBusPendingCall>
#include <QX11Info>
#include <KWindowSystem>
@ -68,6 +69,16 @@ void ProcessManager::start()
void ProcessManager::logout()
{
QDBusInterface kwinIface("org.kde.KWin",
"/Session",
"org.kde.KWin.Session",
QDBusConnection::sessionBus());
if (kwinIface.isValid()) {
// kwinIface.call("aboutToSaveSession", "cutefish");
kwinIface.call("setState", uint(2)); // Quit
}
QMapIterator<QString, QProcess *> i(m_systemProcess);
while (i.hasNext()) {

Loading…
Cancel
Save