Hello community,

here is the log from the commit of package kdebase4-workspace for 
openSUSE:Factory checked in at 2012-04-12 09:30:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kdebase4-workspace (Old)
 and      /work/SRC/openSUSE:Factory/.kdebase4-workspace.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kdebase4-workspace", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kdebase4-workspace/kdebase4-workspace.changes    
2012-03-12 20:14:57.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.kdebase4-workspace.new/kdebase4-workspace.changes   
    2012-04-12 09:31:05.000000000 +0200
@@ -1,0 +2,43 @@
+Mon Apr  2 20:24:34 UTC 2012 - [email protected]
+
+- Add patch for kde#297272 - KWin does not repaint window
+  shadow regions after closing window
+
+-------------------------------------------------------------------
+Sat Mar 31 20:47:22 UTC 2012 - [email protected]
+
+- Change the entry for sysinfo in kickoff to "My Computer" to make 
+  it consistent with the actual window (bnc#626886)
+
+-------------------------------------------------------------------
+Sat Mar 31 08:05:31 UTC 2012 - [email protected]
+
+- Add xz to BuildRequires
+- Remove kdepimlibs4 requirement from base package because this has
+  now been moved into the subpackages that have a real requirement.
+
+-------------------------------------------------------------------
+Fri Mar 30 01:15:41 CEST 2012 - [email protected]
+
+- update to 4.8.2
+  * see http://kde.org/announcements/changelogs/changelog4_8_1to4_8_2.php for 
details
+
+-------------------------------------------------------------------
+Thu Mar 29 06:54:15 UTC 2012 - [email protected]
+
+- Stop installing redundant Network Management backends
+
+-------------------------------------------------------------------
+Tue Mar 20 20:16:03 UTC 2012 - [email protected]
+
+- Added patch to support GRUB2
+- Added patch to resolve reboot/shutdown issue when using systemd
+  and KDM
+
+- Added patch to have initial support within kdebase4-workspace for
+  shutdown/reboot through systemd. Not yet Activated !!
+
+- Included patch from Rober Milasan to set the correct default 
+  homepage for the openSUSE branding
+
+-------------------------------------------------------------------
--- /work/SRC/openSUSE:Factory/kdebase4-workspace/python-kdebase4.changes       
2012-03-12 20:14:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.kdebase4-workspace.new/python-kdebase4.changes  
2012-04-12 09:31:06.000000000 +0200
@@ -1,0 +2,37 @@
+Sat Mar 31 20:47:22 UTC 2012 - [email protected]
+
+- Change the entry for sysinfo in kickoff to "My Computer" to make 
+  it consistent with the actual window (bnc#626886)
+
+-------------------------------------------------------------------
+Sat Mar 31 08:05:31 UTC 2012 - [email protected]
+
+- Add xz to BuildRequires
+- Remove kdepimlibs4 requirement from base package because this has
+  now been moved into the subpackages that have a real requirement.
+
+-------------------------------------------------------------------
+Fri Mar 30 01:15:41 CEST 2012 - [email protected]
+
+- update to 4.8.2
+  * see http://kde.org/announcements/changelogs/changelog4_8_1to4_8_2.php for 
details
+
+-------------------------------------------------------------------
+Thu Mar 29 06:54:15 UTC 2012 - [email protected]
+
+- Stop installing redundant Network Management backends
+
+-------------------------------------------------------------------
+Tue Mar 20 20:16:03 UTC 2012 - [email protected]
+
+- Added patch to support GRUB2
+- Added patch to resolve reboot/shutdown issue when using systemd
+  and KDM
+
+- Added patch to have initial support within kdebase4-workspace for
+  shutdown/reboot through systemd. Not yet Activated !!
+
+- Included patch from Rober Milasan to set the correct default 
+  homepage for the openSUSE branding
+
+-------------------------------------------------------------------

Old:
----
  kde-workspace-4.8.1.tar.bz2

New:
----
  dont-install-solid-netbackends.diff
  kde-workspace-4.8.2.tar.xz
  kdm_grub2.patch
  kdm_systemd_shutdown.patch
  opensuse-homepage.diff
  workspace_systemd_initial_support.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kdebase4-workspace.spec ++++++
--- /var/tmp/diff_new_pack.lCj8iZ/_old  2012-04-12 09:31:09.000000000 +0200
+++ /var/tmp/diff_new_pack.lCj8iZ/_new  2012-04-12 09:31:09.000000000 +0200
@@ -16,14 +16,18 @@
 #
 
 
+%define with_systemd 0
+
 Name:           kdebase4-workspace
-Version:        4.8.1
+Version:        4.8.2
 Release:        0
 Summary:        The KDE Workspace Components
 License:        GPL-2.0+
 Group:          System/GUI/KDE
 Url:            http://www.kde.org/
+%if !%{with_systemd}
 BuildRequires:  ConsoleKit-devel
+%endif
 %if 0%{?suse_version} > 1140
 BuildRequires:  NetworkManager-devel > 0.8.997
 %else
@@ -48,6 +52,7 @@
 BuildRequires:  libusb-devel
 BuildRequires:  pam-devel
 BuildRequires:  pciutils-devel
+BuildRequires:  xz
 BuildRequires:  pkgconfig(libxklavier)
 %if 0%{?suse_version} <= 1140
 # dropped for 12.1
@@ -56,7 +61,7 @@
 %ifnarch s390 s390x
 BuildRequires:  libsensors4-devel
 %endif
-Source0:        kde-workspace-%{version}.tar.bz2
+Source0:        kde-workspace-%{version}.tar.xz
 Source1:        rcksysguardd
 Source2:        titlebar_decor.png
 Source3:        kwin-cubecap.png
@@ -94,13 +99,28 @@
 Patch123:       kdm-fix-generic-greeter.diff
 Patch124:       kdm-fix-labelcolors.diff
 Patch125:       pam-translate.diff
+Patch126:       dont-install-solid-netbackends.diff
 Patch201:       plasma-notifications-kill-timer.diff
 Patch202:       plasma-disable-networkmanager.diff
 Patch211:       disable-python-support.diff
+# PATCH-FIX-OPENSUSE kdm_grub2.patch Ensure that grub2 is recognized
+Patch212:       kdm_grub2.patch
+# PATCH-FIX-OPENSUSE kdm_systemd_shutdown.patch Avoid the situation where 
systemd would kill KDM 
+# which prevents reboot/shutdown (Fedora Patch)
+Patch213:       kdm_systemd_shutdown.patch
+%if %{with_systemd}
+# PATCH-FIX-OPENSUSE workspace_systemd_initial_support.patch
+# This patch rewrites the reboot/shutdown code within workspace so that it 
works with systemd. 
+# Downside is that ConsoleKit is no longer supported and requires that 
NetworkManager and PolKit
+# are also both build with systemd support. Not activated at the moment due to 
sysvinit fallback!!
+Patch214:       workspace_systemd_initial_support.patch
+%endif
 # Patch from Fedora to enable plymouth support in KDM. 
 # Patch is based on the changes within GDM to detect running plymouth 
 # and issue a quit to the plymouth daemon
 Patch400:       kdm_plymouth.patch
+# PATCH-FIX-OPENSUSE opensuse-homepage.diff
+Patch401:       opensuse-homepage.diff
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if %suse_version > 1200
@@ -145,7 +165,6 @@
 # color scheme which is now in -workspace
 Provides:       kdeaccessibility = %{version}
 Obsoletes:      kdeaccessibility < %{version}
-%kde4_pimlibs_requires
 %kde4_runtime_requires
 %define _dminitdir %{_kde4_prefix}/lib/X11/displaymanagers
 
@@ -175,8 +194,8 @@
 Conflicts:      otherproviders(kdm-branding)
 
 %description -n kdm-branding-upstream
-This package contains the upstream branding for KDE 4's kdm, the
-display manager
+This package contains the upstream branding for KDE's display manager
+kdm.
 
 %package ksysguardd
 Summary:        KDE base package: ksysguard daemon
@@ -190,7 +209,7 @@
 This package contains the ksysguard daemon. It is needed for ksysguard.
 
 This package can be installed on servers without any other KDE packages
-to guard the system from remote computers.
+to enable monitoring them remotely with ksysguard.
 
 %package google-gadgets
 Summary:        Google Gadgets support for Plasma
@@ -329,17 +348,27 @@
 %patch124 -p1
 ###KDE47: rediff
 #%%patch125
+%patch126 -p1
 %patch201 -p1
 %patch202 -p1
 %patch211
+%patch212 -p1
+%patch213 -p1
+%if %{with_systemd}
+%patch214 -p1
+%endif
 %patch400 -p0
+%patch401 -p1
 cp %{SOURCE3} kwin/effects/cube/data/cubecap.png
 
 %build
 ### TODO: -DKDE4_ENABLE_FINAL=1
   EXTRA_FLAGS="-DKDE4_COMMON_PAM_SERVICE=xdm \
       -DKDE4_KCHECKPASS_PAM_SERVICE=xdm \
-      -DSYSCONF_INSTALL_DIR=/etc
+      -DSYSCONF_INSTALL_DIR=/etc \
+%if %{with_systemd}
+      -DKWORKSPACE_USE_SYSTEMD=1 \
+%endif
       -DKDE4_ENABLE_FPIE=1"
   %cmake_kde4 -d build -- $EXTRA_FLAGS
   %make_jobs
@@ -503,6 +532,7 @@
 %doc COPYING COPYING.DOC README
 %config %{_kde4_sysconfdir}/init.d/ksysguardd
 %{_kde4_sbindir}/rcksysguardd
+%{_kde4_appsdir}/ksysguard/
 %config(noreplace) %{_kde4_sysconfdir}/ksysguarddrc
 %config %{_kde4_configdir}/ksysguard.knsrc
 

++++++ python-kdebase4.spec ++++++
--- /var/tmp/diff_new_pack.lCj8iZ/_old  2012-04-12 09:31:09.000000000 +0200
+++ /var/tmp/diff_new_pack.lCj8iZ/_new  2012-04-12 09:31:09.000000000 +0200
@@ -17,13 +17,13 @@
 
 
 Name:           python-kdebase4
-Version:        4.8.1
+Version:        4.8.2
 Release:        0
 Summary:        Python bindings for KDE 4 desktop shell
 License:        GPL-2.0+
 Group:          System/GUI/KDE
 Url:            http://www.kde.org/
-Source0:        kde-workspace-%{version}.tar.bz2
+Source0:        kde-workspace-%{version}.tar.xz
 BuildRequires:  ConsoleKit-devel
 BuildRequires:  NetworkManager-devel
 BuildRequires:  bluez-devel

++++++ dont-install-solid-netbackends.diff ++++++
Index: kde-workspace-4.8.1/solid/CMakeLists.txt
===================================================================
--- kde-workspace-4.8.1.orig/solid/CMakeLists.txt
+++ kde-workspace-4.8.1/solid/CMakeLists.txt
@@ -13,7 +13,7 @@ set(HAVE_NETWORKMANAGER FALSE)
 if(NETWORKMANAGER_FOUND)
   if(${NETWORKMANAGER_VERSION} VERSION_GREATER "0.6.9999" AND
      ${NETWORKMANAGER_VERSION} VERSION_LESS "0.8.1001")
-    message(STATUS "Will build networkmanager-0.7")
+  #message(STATUS "Will build networkmanager-0.7")
     set(HAVE_NETWORKMANAGER TRUE)
     add_subdirectory(networkmanager-0.7)
   else()
@@ -21,7 +21,7 @@ if(NETWORKMANAGER_FOUND)
     if (${NETWORKMANAGER_VERSION} VERSION_GREATER "0.8.999")
       message(STATUS "Will build networkmanager_fake-0.9")
       set(HAVE_NETWORKMANAGER TRUE)
-      add_subdirectory(networkmanager_fake-0.9)
+      #add_subdirectory(networkmanager_fake-0.9)
     endif ()
   endif()
 endif (NETWORKMANAGER_FOUND)
@@ -31,9 +31,9 @@ set(HAVE_MODEMMANAGER FALSE)
 if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
   message(STATUS "Will build modemmanager-0.4")
   set(HAVE_MODEMMANAGER TRUE)
-  add_subdirectory(modemmanager-0.4)
+  #add_subdirectory(modemmanager-0.4)
 endif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
 
 if(NOT WIN32)
-  macro_optional_add_subdirectory(wicd)
+   #macro_optional_add_subdirectory(wicd)
 endif(NOT WIN32)
++++++ kdm_grub2.patch ++++++
diff -up kde-workspace-4.8.0/kdm/backend/bootman.c.grub2 
kde-workspace-4.8.0/kdm/backend/bootman.c
--- kde-workspace-4.8.0/kdm/backend/bootman.c.grub2     2012-01-18 
14:08:40.000000000 -0600
+++ kde-workspace-4.8.0/kdm/backend/bootman.c   2012-02-11 13:15:21.341695125 
-0600
@@ -224,8 +224,8 @@ getGrub2OrBurg(char ***opts, int *def, i
 static int
 getGrub2(char ***opts, int *def, int *cur)
 {
-    grubConfig = "/boot/grub/grub.cfg";
-    return getGrub2OrBurg(opts, def, cur, "grub-reboot");
+    grubConfig = "/boot/grub2/grub.cfg";
+    return getGrub2OrBurg(opts, def, cur, "grub2-reboot");
 }
 
 static int
++++++ kdm_systemd_shutdown.patch ++++++
per https://bugzilla.redhat.com/show_bug.cgi?id=796969#c23
The process that executes kdm/backend/session.c:manageSession() is the leader
process of the logind session.

manageSession() calls:

    blockTerm();
    clientExited();
    unblockTerm();

where clientExited() ends the PAM session.
With the current systemd-logind, ending the PAM session will cause the leader
process to be delivered SIGHUP and SIGTERM. The process will die and the
remainder of manageSession() will not be executed.

Interestingly, at the end of the function there's a call to sessionExit(),
which calls clientExited() again.

Removing the three lines quoted above makes reboot from KDE work again. I
haven't noticed any bad effects.

diff -up kde-workspace-4.8.0/kdm/backend/session.c.bz796969 
kde-workspace-4.8.0/kdm/backend/session.c
--- kde-workspace-4.8.0/kdm/backend/session.c.bz796969  2012-01-18 
14:08:40.000000000 -0600
+++ kde-workspace-4.8.0/kdm/backend/session.c   2012-02-28 07:17:16.270219932 
-0600
@@ -662,9 +662,9 @@ manageSession(void)
         sessionExit(EX_AL_RESERVER_DPY);
     }
 
-    blockTerm();
-    clientExited();
-    unblockTerm();
+    /* blockTerm(); */
+    /* clientExited(); */
+    /* unblockTerm(); */
 
     gSet(&mstrtalk);
     gSendInt(D_UnUser);

++++++ opensuse-homepage.diff ++++++
diff -ur 
kde-workspace-4.8.1.orig/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp 
kde-workspace-4.8.1/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp
--- 
kde-workspace-4.8.1.orig/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp   
    2012-03-20 15:15:39.645598514 +0100
+++ kde-workspace-4.8.1/plasma/desktop/applets/kickoff/ui/brandingbutton.cpp    
2012-03-20 15:17:03.369606255 +0100
@@ -68,7 +68,9 @@
 
 void BrandingButton::openHomepage()
 {
-    new KRun(Plasma::Theme::defaultTheme()->homepage(), topLevelWidget(), 
false, false);
+    KUrl suseurl;
+    suseurl = "http://www.opensuse.org";;
+    new KRun(suseurl, topLevelWidget(), false, false);
 }
 
 void BrandingButton::paintEvent(QPaintEvent *event)
++++++ plasma-branding-defaults-applets.diff ++++++
--- /var/tmp/diff_new_pack.lCj8iZ/_old  2012-04-12 09:31:09.000000000 +0200
+++ /var/tmp/diff_new_pack.lCj8iZ/_new  2012-04-12 09:31:09.000000000 +0200
@@ -110,7 +110,7 @@
 +              if (service->name()=="sysinfo") {
 +                      switch(role) {
 +                              case Qt::DisplayRole:
-+                          return i18n("System Information");
++                          return i18n("My Computer");
 +                              case Qt::DecorationRole:
 +                          return KIcon("hwinfo");
 +                              case SubTitleRole:


++++++ workspace_systemd_initial_support.patch ++++++
diff -ur kde-workspace-4.8.0/libs/kworkspace/CMakeLists.txt 
kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/CMakeLists.txt
--- kde-workspace-4.8.0/libs/kworkspace/CMakeLists.txt  2012-01-18 
21:08:42.000000000 +0100
+++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/CMakeLists.txt 
2012-03-01 07:19:09.000000000 +0100
@@ -36,6 +36,11 @@
 endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND AND SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
 
 
+option(KWORKSPACE_USE_SYSTEMD "Use systemd instead of ConsoleKit in 
libkworkspace" OFF)
+if (KWORKSPACE_USE_SYSTEMD)
+    add_definitions(-DKWORKSPACE_USE_SYSTEMD=1)
+endif (KWORKSPACE_USE_SYSTEMD)
+
 
 set(ksmserver_xml  
${KDEBASE_WORKSPACE_SOURCE_DIR}/ksmserver/org.kde.KSMServerInterface.xml)
 qt4_add_dbus_interface( kworkspace_LIB_SRCS ${ksmserver_xml} 
ksmserver_interface )
diff -ur kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp 
kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp
--- kde-workspace-4.8.0/libs/kworkspace/kdisplaymanager.cpp     2012-01-18 
21:08:42.000000000 +0100
+++ kde-workspace-4.8.0-systemd-shutdown/libs/kworkspace/kdisplaymanager.cpp    
2012-03-14 04:19:46.000000000 +0100
@@ -40,6 +40,91 @@
 #include <errno.h>
 #include <stdio.h>
 
+#ifdef KWORKSPACE_USE_SYSTEMD
+struct NamedDBusObjectPath
+{
+    QString name;
+    QDBusObjectPath path;
+};
+Q_DECLARE_METATYPE(NamedDBusObjectPath)
+Q_DECLARE_METATYPE(QList<NamedDBusObjectPath>)
+
+// Marshall the NamedDBusObjectPath data into a D-Bus argument
+QDBusArgument &operator<<(QDBusArgument &argument, const NamedDBusObjectPath 
&namedPath)
+{
+    argument.beginStructure();
+    argument << namedPath.name << namedPath.path;
+    argument.endStructure();
+    return argument;
+}
+
+// Retrieve the NamedDBusObjectPath data from the D-Bus argument
+const QDBusArgument &operator>>(const QDBusArgument &argument, 
NamedDBusObjectPath &namedPath)
+{
+    argument.beginStructure();
+    argument >> namedPath.name >> namedPath.path;
+    argument.endStructure();
+    return argument;
+}
+
+struct NumberedDBusObjectPath
+{
+    uint num;
+    QDBusObjectPath path;
+};
+Q_DECLARE_METATYPE(NumberedDBusObjectPath)
+
+// Marshall the NumberedDBusObjectPath data into a D-Bus argument
+QDBusArgument &operator<<(QDBusArgument &argument, const 
NumberedDBusObjectPath &numberedPath)
+{
+    argument.beginStructure();
+    argument << numberedPath.num << numberedPath.path;
+    argument.endStructure();
+    return argument;
+}
+
+// Retrieve the NumberedDBusObjectPath data from the D-Bus argument
+const QDBusArgument &operator>>(const QDBusArgument &argument, 
NumberedDBusObjectPath &numberedPath)
+{
+    argument.beginStructure();
+    argument >> numberedPath.num >> numberedPath.path;
+    argument.endStructure();
+    return argument;
+}
+
+class SystemdManager : public QDBusInterface
+{
+public:
+    SystemdManager() :
+        QDBusInterface(
+                QLatin1String("org.freedesktop.login1"),
+                QLatin1String("/org/freedesktop/login1"),
+                QLatin1String("org.freedesktop.login1.Manager"),
+                QDBusConnection::systemBus()) {}
+};
+
+class SystemdSeat : public QDBusInterface
+{
+public:
+    SystemdSeat(const QDBusObjectPath &path) :
+        QDBusInterface(
+                QLatin1String("org.freedesktop.login1"),
+                path.path(),
+                QLatin1String("org.freedesktop.login1.Seat"),
+                QDBusConnection::systemBus()) {}
+};
+
+class SystemdSession : public QDBusInterface
+{
+public:
+    SystemdSession(const QDBusObjectPath &path) :
+        QDBusInterface(
+                QLatin1String("org.freedesktop.login1"),
+                path.path(),
+                QLatin1String("org.freedesktop.login1.Session"),
+                QDBusConnection::systemBus()) {}
+};
+#else
 class CKManager : public QDBusInterface
 {
 public:
@@ -68,10 +153,11 @@
     CKSession(const QDBusObjectPath &path) :
         QDBusInterface(
                 QLatin1String("org.freedesktop.ConsoleKit"),
-            path.path(),
+                path.path(),
                 QLatin1String("org.freedesktop.ConsoleKit.Session"),
                 QDBusConnection::systemBus()) {}
 };
+#endif
 
 class GDMFactory : public QDBusInterface
 {
@@ -131,6 +217,11 @@
     }
     switch (DMType) {
     default:
+#ifdef KWORKSPACE_USE_SYSTEMD
+        qDBusRegisterMetaType<NamedDBusObjectPath>();
+        qDBusRegisterMetaType<QList<NamedDBusObjectPath> >();
+        qDBusRegisterMetaType<NumberedDBusObjectPath>();
+#endif
         return;
     case NewKDM:
     case OldGDM:
@@ -242,6 +333,23 @@
 
 static bool getCurrentSeat(QDBusObjectPath *currentSession, QDBusObjectPath 
*currentSeat)
 {
+#ifdef KWORKSPACE_USE_SYSTEMD
+    SystemdManager man;
+    QDBusReply<QDBusObjectPath> r = man.call(QLatin1String("GetSessionByPID"), 
(uint) QCoreApplication::applicationPid());
+    if (r.isValid()) {
+        SystemdSession sess(r.value());
+        if (sess.isValid()) {
+            QVariant p = sess.property("Seat");
+            if (p.canConvert<NamedDBusObjectPath>()) {
+                NamedDBusObjectPath namedPath = p.value<NamedDBusObjectPath>();
+                if (currentSession)
+                    *currentSession = r.value();
+                *currentSeat = namedPath.path;
+                return true;
+            }
+        }
+    }
+#else
     CKManager man;
     QDBusReply<QDBusObjectPath> r = 
man.call(QLatin1String("GetCurrentSession"));
     if (r.isValid()) {
@@ -256,11 +364,28 @@
             }
         }
     }
+#endif
     return false;
 }
 
 static QList<QDBusObjectPath> getSessionsForSeat(const QDBusObjectPath &path)
 {
+#ifdef KWORKSPACE_USE_SYSTEMD
+    SystemdSeat seat(path);
+    if (seat.isValid()) {
+        QVariant p = seat.property("Sessions");
+        if (p.canConvert<QList<NamedDBusObjectPath> >()) {
+            QList<NamedDBusObjectPath> r = p.value<QList<NamedDBusObjectPath> 
>();
+            QList<QDBusObjectPath> result;
+            foreach (const NamedDBusObjectPath &namedPath, r)
+                result.append(namedPath.path);
+            // This will contain only local sessions:
+            // - this is only ever called when isSwitchable() is true => local 
seat
+            // - remote logins into the machine are assigned to other seats
+            return result;
+        }
+    }
+#else
     CKSeat seat(path);
     if (seat.isValid()) {
         QDBusReply<QList<QDBusObjectPath> > r = 
seat.call(QLatin1String("GetSessions"));
@@ -271,9 +396,18 @@
             return r.value();
         }
     }
+#endif
     return QList<QDBusObjectPath>();
 }
 
+#ifdef KWORKSPACE_USE_SYSTEMD
+static void getSessionLocation(SystemdSession &lsess, SessEnt &se)
+{
+    se.tty = (lsess.property("Type").toString() != QLatin1String("x11"));
+    se.display = lsess.property(se.tty ? "TTY" : "Display").toString();
+    se.vt = lsess.property("VTNr").toInt();
+}
+#else
 static void getSessionLocation(CKSession &lsess, SessEnt &se)
 {
     QString tty;
@@ -291,14 +425,20 @@
     }
     se.vt = tty.mid(strlen("/dev/tty")).toInt();
 }
+#endif
 
 #ifndef KDM_NO_SHUTDOWN
 bool
 KDisplayManager::canShutdown()
 {
     if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+        QDBusReply<QString> canPowerOff = 
SystemdManager().call(QLatin1String("CanPowerOff"));
+        return (canPowerOff.isValid() && canPowerOff.value() != 
QLatin1String("no"));
+#else
         QDBusReply<bool> canStop = CKManager().call(QLatin1String("CanStop"));
         return (canStop.isValid() && canStop.value());
+#endif
     }
 
     if (DMType == OldKDM)
@@ -329,9 +469,21 @@
             return;
 
         if (DMType == NewGDM || DMType == NoDM || DMType == LightDM) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+            // systemd supports only 2 modes:
+            // * interactive = true: brings up a PolicyKit prompt if other 
sessions are active
+            // * interactive = false: rejects the shutdown if other sessions 
are active
+            // There are no schedule or force modes.
+            // We try to map our 4 shutdown modes in the sanest way.
+            bool interactive = (shutdownMode == 
KWorkSpace::ShutdownModeInteractive
+                                || shutdownMode == 
KWorkSpace::ShutdownModeForceNow);
+            SystemdManager().call(QLatin1String(
+                    shutdownType == KWorkSpace::ShutdownTypeReboot ? "Reboot" 
: "PowerOff"), interactive);
+#else
             // FIXME: entirely ignoring shutdownMode
             CKManager().call(QLatin1String(
                     shutdownType == KWorkSpace::ShutdownTypeReboot ? "Restart" 
: "Stop"));
+#endif
             return;
         }
 
@@ -406,12 +558,18 @@
     if (DMType == NewGDM || DMType == LightDM) {
         QDBusObjectPath currentSeat;
         if (getCurrentSeat(0, &currentSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+            SystemdSeat seat(currentSeat);
+            if (seat.isValid())
+                return seat.property("CanMultiSession").toBool();
+#else
             CKSeat seat(currentSeat);
             if (seat.isValid()) {
                 QDBusReply<bool> r = 
seat.call(QLatin1String("CanActivateSessions"));
                 if (r.isValid())
                     return r.value();
             }
+#endif
         }
         return false;
     }
@@ -469,6 +627,21 @@
         QDBusObjectPath currentSession, currentSeat;
         if (getCurrentSeat(&currentSession, &currentSeat)) {
             foreach (const QDBusObjectPath &sp, 
getSessionsForSeat(currentSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+                SystemdSession lsess(sp);
+                if (lsess.isValid()) {
+                    SessEnt se;
+                    getSessionLocation(lsess, se);
+                    if (lsess.property("Class").toString() != 
QLatin1String("greeter")) {
+                        QVariant p = lsess.property("User");
+                        NumberedDBusObjectPath numberedPath = 
p.value<NumberedDBusObjectPath>();
+                        se.user = KUser(K_UID(numberedPath.num)).loginName();
+                        se.session = "<unknown>";
+                    }
+                    se.self = (sp == currentSession);
+                    list.append(se);
+                }
+#else
                 CKSession lsess(sp);
                 if (lsess.isValid()) {
                     SessEnt se;
@@ -484,6 +657,7 @@
                     se.self = (sp == currentSession);
                     list.append(se);
                 }
+#endif
             }
             return true;
         }
@@ -567,6 +741,21 @@
         QDBusObjectPath currentSeat;
         if (getCurrentSeat(0, &currentSeat)) {
             foreach (const QDBusObjectPath &sp, 
getSessionsForSeat(currentSeat)) {
+#ifdef KWORKSPACE_USE_SYSTEMD
+                SystemdSession lsess(sp);
+                if (lsess.isValid()) {
+                    SessEnt se;
+                    getSessionLocation(lsess, se);
+                    if (se.vt == vt) {
+#if 0
+                        if (se.tty) // FIXME: Does systemd ignore these like 
ConsoleKit does?
+                            return false;
+#endif
+                        lsess.call(QLatin1String("Activate"));
+                        return true;
+                    }
+                }
+#else
                 CKSession lsess(sp);
                 if (lsess.isValid()) {
                     SessEnt se;
@@ -578,6 +767,7 @@
                         return true;
                     }
                 }
+#endif
             }
         }
         return false;
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to