summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Gauduin2015-06-09 12:02:24 +0200
committerMaxime Gauduin2015-06-09 12:02:24 +0200
commitee2b2f6a5319e6a9150c5b1569ae33ddddef4d20 (patch)
treea7dd4407101a2b12acd4b0bd2ec41e0bf6ef3207
downloadaur-ee2b2f6a5319e6a9150c5b1569ae33ddddef4d20.tar.gz
Initial import
-rw-r--r--.SRCINFO31
-rw-r--r--MKPKG4
-rw-r--r--PKGBUILD69
-rw-r--r--fix-build.patch12
-rw-r--r--fix-fallback-icon.patch66
-rw-r--r--gdbus-port.patch209
-rw-r--r--indicator-session.install13
-rw-r--r--remove-unused-deps.patch44
-rw-r--r--support-reboot.patch28
-rw-r--r--systemd-support.patch85
10 files changed, 561 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..df6bdf83b2cc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = indicator-session
+ pkgdesc = Indicator showing session management, status and user switching
+ pkgver = 12.10.4
+ pkgrel = 5
+ url = https://launchpad.net/indicator-session
+ install = indicator-session.install
+ arch = i686
+ arch = x86_64
+ groups = pantheon
+ groups = pantheon-unstable
+ license = GPL
+ makedepends = intltool
+ depends = libdbusmenu-gtk3
+ depends = libindicator-gtk3
+ source = https://launchpad.net/indicator-session/12.10/12.10.4/+download/indicator-session-12.10.4.tar.gz
+ source = remove-unused-deps.patch
+ source = gdbus-port.patch
+ source = fix-build.patch
+ source = fix-fallback-icon.patch
+ source = support-reboot.patch
+ source = systemd-support.patch
+ sha256sums = 6b640f936273f709a2a67d1edfebbf342a6a899a53d9791747c899faa0fcd384
+ sha256sums = bbc3fed2c7d5311caaea56bd424f3ffea45afbaf53c9f0700b377f3858ffd9f7
+ sha256sums = d65b661a52e68abf745a169e1a8518d1450f439b5cd314f5fee3f883ba0f7747
+ sha256sums = 2dda11ce7c7a7877de1b163ee13439fdb0885d63b34cefde81af2e09be3b83e5
+ sha256sums = 55099631308aa044399fb959ac4b03f11b7e961415ee74487935a9360553896e
+ sha256sums = 6412b10212e97c6c828af8025ce36b609b58a77126c639d8b28a33c5b9490c79
+ sha256sums = 98da140123c78e648311e6d2350a5405916e1b59f97694b4fc71af1f7df716eb
+
+pkgname = indicator-session
+
diff --git a/MKPKG b/MKPKG
new file mode 100644
index 000000000000..282fb4d47dfd
--- /dev/null
+++ b/MKPKG
@@ -0,0 +1,4 @@
+pkgname=('indicator-session')
+builddeps=('ido' 'libindicator-gtk3')
+
+# vim: ts=2 sw=2 et:
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..103ac819cbb0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,69 @@
+# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
+# Contributor: Balló György <ballogyor+arch@gmail.com>
+
+pkgname=indicator-session
+pkgver=12.10.4
+pkgrel=5
+pkgdesc='Indicator showing session management, status and user switching'
+arch=('i686' 'x86_64')
+url='https://launchpad.net/indicator-session'
+license=('GPL')
+groups=('pantheon' 'pantheon-unstable')
+depends=('libdbusmenu-gtk3' 'libindicator-gtk3')
+makedepends=('intltool')
+install='indicator-session.install'
+source=("https://launchpad.net/indicator-session/${pkgver%.*}/${pkgver}/+download/indicator-session-${pkgver}.tar.gz"
+ 'remove-unused-deps.patch'
+ 'gdbus-port.patch'
+ 'fix-build.patch'
+ 'fix-fallback-icon.patch'
+ 'support-reboot.patch'
+ 'systemd-support.patch')
+sha256sums=('6b640f936273f709a2a67d1edfebbf342a6a899a53d9791747c899faa0fcd384'
+ 'bbc3fed2c7d5311caaea56bd424f3ffea45afbaf53c9f0700b377f3858ffd9f7'
+ 'd65b661a52e68abf745a169e1a8518d1450f439b5cd314f5fee3f883ba0f7747'
+ '2dda11ce7c7a7877de1b163ee13439fdb0885d63b34cefde81af2e09be3b83e5'
+ '55099631308aa044399fb959ac4b03f11b7e961415ee74487935a9360553896e'
+ '6412b10212e97c6c828af8025ce36b609b58a77126c639d8b28a33c5b9490c79'
+ '98da140123c78e648311e6d2350a5405916e1b59f97694b4fc71af1f7df716eb')
+
+prepare() {
+ cd indicator-session-${pkgver}
+
+ patch -Np0 -i ../remove-unused-deps.patch
+ patch -Np0 -i ../gdbus-port.patch
+ patch -Np1 -i ../fix-build.patch
+ patch -Np0 -i ../fix-fallback-icon.patch
+ patch -Np1 -i ../support-reboot.patch
+ patch -Np0 -i ../systemd-support.patch
+ sed -i 's/gnome-control-center credentials/credentials-preferences/' src/online-accounts-mgr.c
+ sed -i 's/Ubuntu Help/Desktop Help/' src/session-menu-mgr.c
+}
+
+build() {
+ cd indicator-session-${pkgver}
+
+ export CFLAGS="$CFLAGS -Wno-deprecated-declarations"
+
+ autoreconf -fi
+ ./configure \
+ --prefix='/usr' \
+ --libexecdir='/usr/lib/indicator-session' \
+ --localstatedir='/var' \
+ --sysconfdir='/etc' \
+ --disable-gtklogouthelper \
+ --disable-schemas-compile \
+ --disable-static
+ make
+}
+
+package() {
+ cd indicator-session-${pkgver}
+
+ make DESTDIR="${pkgdir}" install
+
+# Remove guest session
+ rm -r "${pkgdir}"/usr/share/indicators
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/fix-build.patch b/fix-build.patch
new file mode 100644
index 000000000000..57aa242b3451
--- /dev/null
+++ b/fix-build.patch
@@ -0,0 +1,12 @@
+diff -Naur indicator-session-12.10.4.orig/configure.ac indicator-session-12.10.4/configure.ac
+--- indicator-session-12.10.4.orig/configure.ac 2012-10-03 18:39:45.000000000 +0200
++++ indicator-session-12.10.4/configure.ac 2013-03-10 16:36:09.975334792 +0100
+@@ -3,7 +3,7 @@
+
+ AC_PREREQ(2.53)
+
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ AM_INIT_AUTOMAKE(indicator-session, 12.10.4)
+
+ AM_MAINTAINER_MODE
diff --git a/fix-fallback-icon.patch b/fix-fallback-icon.patch
new file mode 100644
index 000000000000..fe9ef5c774f6
--- /dev/null
+++ b/fix-fallback-icon.patch
@@ -0,0 +1,66 @@
+=== modified file 'src/indicator-session.c'
+--- src/indicator-session.c 2012-11-14 20:20:13 +0000
++++ src/indicator-session.c 2013-01-02 07:47:31 +0000
+@@ -64,7 +64,6 @@
+ GDBusProxy * service_proxy;
+ GSettings * settings;
+ DbusmenuClient * menu_client;
+- GtkIconTheme * icon_theme;
+ };
+
+ GType indicator_session_get_type (void);
+@@ -79,7 +78,6 @@
+ DbusmenuClient * client,
+ gpointer user_data);
+ static void on_menu_layout_updated (DbusmenuClient * client, IndicatorSession * session);
+-static void indicator_session_update_icon_callback (GtkWidget * widget, gpointer callback_data);
+ static void indicator_session_update_icon_and_a11y (IndicatorSession * self);
+ static void indicator_session_update_users_label (IndicatorSession* self,
+ const gchar* name);
+@@ -129,13 +127,6 @@
+ self->entry.image = GTK_IMAGE (gtk_image_new());
+ self->entry.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME,
+ INDICATOR_SESSION_DBUS_OBJECT));
+- /* We need to check if the current icon theme has the hard coded icons.
+- * If not, we'll fall back to a standard icon */
+- self->icon_theme = gtk_icon_theme_get_default();
+- g_signal_connect(G_OBJECT(self->icon_theme),
+- "changed",
+- G_CALLBACK(indicator_session_update_icon_callback), self);
+-
+ indicator_session_update_icon_and_a11y (self);
+ g_settings_bind (self->settings, "show-real-name-on-panel",
+ self->entry.label, "visible",
+@@ -408,13 +399,11 @@
+ else
+ icon = ICON_ALERT;
+
+- if (gtk_icon_theme_has_icon (indicator->icon_theme, icon) == FALSE)
+- icon = "gtk-missing-image";
+-
+- g_debug (G_STRLOC" setting icon to \"%s\"", icon);
+- gtk_image_set_from_icon_name (GTK_IMAGE(indicator->entry.image),
+- icon,
+- GTK_ICON_SIZE_BUTTON);
++ GIcon * gicon = g_themed_icon_new_with_default_fallbacks (icon);
++ gtk_image_set_from_gicon (GTK_IMAGE(indicator->entry.image),
++ gicon,
++ GTK_ICON_SIZE_BUTTON);
++ g_object_unref(gicon);
+ }
+
+ static int
+@@ -448,12 +437,6 @@
+ }
+
+ static void
+-indicator_session_update_icon_callback (GtkWidget * widget, gpointer callback_data)
+-{
+- indicator_session_update_icon_and_a11y ((IndicatorSession *)callback_data);
+-}
+-
+-static void
+ indicator_session_update_icon_and_a11y (IndicatorSession * indicator)
+ {
+ const int disposition = calculate_disposition (indicator);
+
diff --git a/gdbus-port.patch b/gdbus-port.patch
new file mode 100644
index 000000000000..e5cfbbbd6ec7
--- /dev/null
+++ b/gdbus-port.patch
@@ -0,0 +1,209 @@
+=== modified file 'configure.ac'
+--- configure.ac 2012-11-16 18:13:45 +0000
++++ configure.ac 2012-11-29 22:09:57 +0000
+@@ -46,7 +46,6 @@
+ PKG_CHECK_MODULES(SESSIONSERVICE, glib-2.0 >= $GLIB_REQUIRED_VERSION
+ dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
+ dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
+- dbus-glib-1
+ gio-unix-2.0
+ indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
+ packagekit-glib2)
+
+=== modified file 'src/gtk-logout-helper.c'
+--- src/gtk-logout-helper.c 2012-06-20 19:33:06 +0000
++++ src/gtk-logout-helper.c 2012-11-29 22:09:57 +0000
+@@ -26,109 +26,123 @@
+ #include <locale.h>
+ #include <glib.h>
+ #include <glib/gi18n.h> /* textdomain(), bindtextdomain() */
+-#include <dbus/dbus-glib.h>
+ #include <gtk/gtk.h>
+ #include "dialog.h"
+ #include "shared-names.h"
+
++static GVariant *
++call_console_kit (const gchar *method, GVariant *parameters, GError **error)
++{
++ GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, error);
++ if (!bus)
++ {
++ g_variant_unref (parameters);
++ return NULL;
++ }
++
++ GVariant *result = g_dbus_connection_call_sync(bus,
++ "org.freedesktop.ConsoleKit",
++ "/org/freedesktop/ConsoleKit/Manager",
++ "org.freedesktop.ConsoleKit.Manager",
++ method,
++ parameters,
++ NULL,
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ NULL,
++ error);
++ g_object_unref (bus);
++
++ return result;
++}
++
+ static void
+ consolekit_fallback (LogoutDialogType action)
+ {
++ GError * error = NULL;
++ GVariant *result = NULL;
++
+ g_debug("Falling back to using ConsoleKit for action");
+
+- DBusGConnection * sbus = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
+- g_return_if_fail(sbus != NULL); /* worst case */
+- DBusGProxy * proxy = dbus_g_proxy_new_for_name(sbus, "org.freedesktop.ConsoleKit",
+- "/org/freedesktop/ConsoleKit/Manager",
+- "org.freedesktop.ConsoleKit.Manager");
+-
+- if (proxy == NULL) {
+- g_warning("Unable to get consolekit proxy");
+- return;
+- }
+-
+- GError * error = NULL;
+-
+ switch (action) {
+ case LOGOUT_DIALOG_TYPE_LOG_OUT:
+ g_warning("Unable to fallback to ConsoleKit for logout as it's a session issue. We need some sort of session handler.");
+ break;
+ case LOGOUT_DIALOG_TYPE_SHUTDOWN:
+ g_debug("Telling ConsoleKit to 'Stop'");
+- dbus_g_proxy_call(proxy,
+- "Stop",
+- &error,
+- G_TYPE_INVALID,
+- G_TYPE_INVALID);
++ result = call_console_kit ("Stop", g_variant_new ("()"), &error);
+ break;
+ case LOGOUT_DIALOG_TYPE_RESTART:
+ g_debug("Telling ConsoleKit to 'Restart'");
+- dbus_g_proxy_call(proxy,
+- "Restart",
+- &error,
+- G_TYPE_INVALID,
+- G_TYPE_INVALID);
++ result = call_console_kit ("Restart", g_variant_new ("()"), &error);
+ break;
+ default:
+ g_warning("Unknown action");
+ break;
+ }
+
+- g_object_unref(proxy);
++ if (!result) {
++ if (error != NULL) {
++ g_warning ("ConsoleKit action failed: %s", error->message);
++ } else {
++ g_warning ("ConsoleKit action failed: unknown error");
++ }
+
+- if (error != NULL) {
+- g_warning("Unable to signal ConsoleKit");
+- g_error_free(error);
++ consolekit_fallback(action);
+ }
++ else
++ g_variant_unref (result);
++ g_clear_error (&error);
+
+ return;
+ }
+
++static GVariant *
++call_gnome_session (const gchar *method, GVariant *parameters, GError **error)
++{
++ GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, error);
++ if (!bus)
++ {
++ g_variant_unref (parameters);
++ return NULL;
++ }
++
++ GVariant *result = g_dbus_connection_call_sync(bus,
++ "org.gnome.SessionManager",
++ "/org/gnome/SessionManager",
++ "org.gnome.SessionManager",
++ method,
++ parameters,
++ NULL,
++ G_DBUS_CALL_FLAGS_NONE,
++ G_MAXINT,
++ NULL,
++ error);
++ g_object_unref (bus);
++
++ return result;
++}
++
+ static void
+ session_action (LogoutDialogType action)
+ {
+- DBusGConnection * sbus;
+- DBusGProxy * sm_proxy;
+ GError * error = NULL;
+- gboolean res = FALSE;
+-
+- sbus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+- if (sbus == NULL) {
+- g_warning("Unable to get DBus session bus.");
+- return;
+- }
+- sm_proxy = dbus_g_proxy_new_for_name_owner (sbus,
+- "org.gnome.SessionManager",
+- "/org/gnome/SessionManager",
+- "org.gnome.SessionManager",
+- &error);
+- if (sm_proxy == NULL) {
+- g_warning("Unable to get DBus proxy to SessionManager interface: %s", error->message);
+- g_error_free(error);
++ GVariant *result = NULL;
+
+- consolekit_fallback(action);
+- return;
+- }
+-
+- g_clear_error (&error);
+-
+ if (action == LOGOUT_DIALOG_TYPE_LOG_OUT) {
+ g_debug("Asking Session manager to 'Logout'");
+- res = dbus_g_proxy_call_with_timeout (sm_proxy, "Logout", INT_MAX, &error,
+- G_TYPE_UINT, 1, G_TYPE_INVALID, G_TYPE_INVALID);
++ result = call_gnome_session ("Logout", g_variant_new ("(u)", 1), &error);
+ } else if (action == LOGOUT_DIALOG_TYPE_SHUTDOWN) {
+ g_debug("Asking Session manager to 'RequestShutdown'");
+- res = dbus_g_proxy_call_with_timeout (sm_proxy, "RequestShutdown", INT_MAX, &error,
+- G_TYPE_INVALID, G_TYPE_INVALID);
++ result = call_gnome_session ("RequestShutdown", g_variant_new ("()"), &error);
+ } else if (action == LOGOUT_DIALOG_TYPE_RESTART) {
+ g_debug("Asking Session manager to 'RequestReboot'");
+- res = dbus_g_proxy_call_with_timeout (sm_proxy, "RequestReboot", INT_MAX, &error,
+- G_TYPE_INVALID, G_TYPE_INVALID);
++ result = call_gnome_session ("RequestReboot", g_variant_new ("()"), &error);
+ } else {
+ g_warning ("Unknown session action");
+ }
+
+- if (!res) {
++ if (!result) {
+ if (error != NULL) {
+ g_warning ("SessionManager action failed: %s", error->message);
+ } else {
+@@ -137,8 +151,8 @@
+
+ consolekit_fallback(action);
+ }
+-
+- g_object_unref(sm_proxy);
++ else
++ g_variant_unref (result);
+ g_clear_error (&error);
+
+ return;
+
diff --git a/indicator-session.install b/indicator-session.install
new file mode 100644
index 000000000000..511a2a0c7807
--- /dev/null
+++ b/indicator-session.install
@@ -0,0 +1,13 @@
+post_install() {
+ glib-compile-schemas /usr/share/glib-2.0/schemas
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/remove-unused-deps.patch b/remove-unused-deps.patch
new file mode 100644
index 000000000000..7a0c438b3806
--- /dev/null
+++ b/remove-unused-deps.patch
@@ -0,0 +1,44 @@
+=== modified file 'configure.ac'
+--- configure.ac 2012-11-29 22:09:57 +0000
++++ configure.ac 2012-11-30 16:24:17 +0000
+@@ -30,7 +30,6 @@
+ GTK_REQUIRED_VERSION=3.0
+ INDICATOR_REQUIRED_VERSION=0.3.19
+ DBUSMENUGTK_REQUIRED_VERSION=0.5.90
+-POLKIT_REQUIRED_VERSION=0.92
+ DBUSTEST_REQUIRED_VERSION=0.0.5
+ DBUSMENUGLIB_REQUIRED_VERSION=0.1.1
+
+@@ -47,8 +46,7 @@
+ dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
+ dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
+ gio-unix-2.0
+- indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
+- packagekit-glib2)
++ indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION)
+ AC_SUBST(SESSIONERVICE_CFLAGS)
+ AC_SUBST(SESSIONERVICE_LIBS)
+
+@@ -60,14 +58,15 @@
+ ###########################
+
+ AC_ARG_ENABLE([gtklogouthelper],
+- AS_HELP_STRING([--enable-gtklogouthelper], [enable GTK Logout Helper]),,
+- enable_gtklogouthelper=auto)
++ [AS_HELP_STRING([--enable-gtklogouthelper], [enable GTK Logout Helper])],
++ [],
++ [enable_gtklogouthelper=auto])
+
+ if test x"$enable_gtklogouthelper" != x"no" ; then
+- PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-3.0 >= $GTK_REQUIRED_VERSION
+- polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+- [have_gtklogouthelper=yes],
+- [have_gtklogouthelper=no])
++ PKG_CHECK_MODULES([GTKLOGOUTHELPER],
++ [gtk+-3.0 >= $GTK_REQUIRED_VERSION],
++ [have_gtklogouthelper=yes],
++ [have_gtklogouthelper=no])
+ if test x${have_gtklogouthelper} = xyes; then
+ AC_DEFINE(HAVE_GTKLOGOUTHELPER, 1, [Define to 1 to enable GTK Logout Helper])
+ fi
+
diff --git a/support-reboot.patch b/support-reboot.patch
new file mode 100644
index 000000000000..892f32b9f4c7
--- /dev/null
+++ b/support-reboot.patch
@@ -0,0 +1,28 @@
+diff -Naur indicator-session-12.10.4.orig/src/session-menu-mgr.c indicator-session-12.10.4/src/session-menu-mgr.c
+--- indicator-session-12.10.4.orig/src/session-menu-mgr.c 2012-10-03 18:39:38.000000000 +0200
++++ indicator-session-12.10.4/src/session-menu-mgr.c 2012-12-09 23:14:23.511412143 +0100
+@@ -44,13 +44,11 @@
+ #define CMD_INFO "gnome-control-center info"
+ #define CMD_SYSTEM_SETTINGS "gnome-control-center"
+ #ifdef HAVE_GTKLOGOUTHELPER
+- #define HAVE_RESTART_CMD TRUE
+ #define CMD_RESTART LIBEXECDIR"/gtk-logout-helper --restart"
+ #define CMD_LOGOUT LIBEXECDIR"/gtk-logout-helper --logout"
+ #define CMD_SHUTDOWN LIBEXECDIR"/gtk-logout-helper --shutdown"
+ #else
+- #define HAVE_RESTART_CMD FALSE /* hmm, no gnome-session-quit --restart? */
+- #define CMD_RESTART ""
++ #define CMD_RESTART "gnome-session-quit --reboot"
+ #define CMD_LOGOUT "gnome-session-quit --logout"
+ #define CMD_SHUTDOWN "gnome-session-quit --power-off"
+ #endif
+@@ -463,8 +461,7 @@
+ && mgr->allow_hibernate;
+ mi_set_visible (mgr->hibernate_mi, v);
+
+- v = HAVE_RESTART_CMD
+- && !g_settings_get_boolean (s, "suppress-restart-menuitem");
++ v = !g_settings_get_boolean (s, "suppress-restart-menuitem");
+ mi_set_visible (mgr->restart_mi, v);
+
+ v = !g_settings_get_boolean (s, "suppress-shutdown-menuitem");
diff --git a/systemd-support.patch b/systemd-support.patch
new file mode 100644
index 000000000000..8c39f834678d
--- /dev/null
+++ b/systemd-support.patch
@@ -0,0 +1,85 @@
+=== modified file 'src/gtk-logout-helper.c'
+--- src/gtk-logout-helper.c 2012-11-29 22:09:57 +0000
++++ src/gtk-logout-helper.c 2013-01-02 19:00:42 +0000
+@@ -31,6 +31,71 @@
+ #include "shared-names.h"
+
+ static GVariant *
++call_systemd (const gchar *method, GVariant *parameters, GError **error)
++{
++ GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, error);
++ if (!bus)
++ {
++ g_variant_unref (parameters);
++ return NULL;
++ }
++
++ GVariant *result = g_dbus_connection_call_sync(bus,
++ "org.freedesktop.login1",
++ "/org/freedesktop/login1",
++ "org.freedesktop.login1.Manager",
++ method,
++ parameters,
++ NULL,
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ NULL,
++ error);
++ g_object_unref (bus);
++
++ return result;
++}
++
++static void
++systemd_fallback (LogoutDialogType action)
++{
++ GError * error = NULL;
++ GVariant *result = NULL;
++
++ g_debug("Falling back to using systemd for action");
++
++ switch (action) {
++ case LOGOUT_DIALOG_TYPE_LOG_OUT:
++ g_warning("Unable to fallback to systemd for logout as it's a session issue. We need some sort of session handler.");
++ break;
++ case LOGOUT_DIALOG_TYPE_SHUTDOWN:
++ g_debug("Telling systemd to 'PowerOff'");
++ result = call_systemd ("PowerOff", g_variant_new ("(b)", TRUE), &error);
++ break;
++ case LOGOUT_DIALOG_TYPE_RESTART:
++ g_debug("Telling systemd to 'Reboot'");
++ result = call_systemd ("Reboot", g_variant_new ("(b)", TRUE), &error);
++ break;
++ default:
++ g_warning("Unknown action");
++ break;
++ }
++
++ if (!result) {
++ if (error != NULL) {
++ g_warning ("systemd action failed: %s", error->message);
++ } else {
++ g_warning ("systemd action failed: unknown error");
++ }
++ }
++ else
++ g_variant_unref (result);
++ g_clear_error (&error);
++
++ return;
++}
++
++static GVariant *
+ call_console_kit (const gchar *method, GVariant *parameters, GError **error)
+ {
+ GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, error);
+@@ -88,7 +153,7 @@
+ g_warning ("ConsoleKit action failed: unknown error");
+ }
+
+- consolekit_fallback(action);
++ systemd_fallback(action);
+ }
+ else
+ g_variant_unref (result);
+