[arch-commits] Commit in gnome-screensaver/trunk (3 files)
Balló György
bgyorgy at nymeria.archlinux.org
Sat Nov 30 20:33:06 UTC 2013
Date: Saturday, November 30, 2013 @ 21:33:06
Author: bgyorgy
Revision: 101766
upgpkg: gnome-screensaver 3.6.1-7
- Fix systemd support
- Add support for user switch with LightDM
Added:
gnome-screensaver/trunk/fix-systemd-support.patch
gnome-screensaver/trunk/lightdm_switch_user.patch
Modified:
gnome-screensaver/trunk/PKGBUILD
---------------------------+
PKGBUILD | 19 ++++++--
fix-systemd-support.patch | 91 ++++++++++++++++++++++++++++++++++++++++
lightdm_switch_user.patch | 100 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 205 insertions(+), 5 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2013-11-30 19:30:55 UTC (rev 101765)
+++ PKGBUILD 2013-11-30 20:33:06 UTC (rev 101766)
@@ -5,11 +5,11 @@
pkgname=gnome-screensaver
pkgver=3.6.1
-pkgrel=6
+pkgrel=7
pkgdesc="Legacy GNOME screensaver"
arch=('i686' 'x86_64')
license=('GPL')
-url="http://live.gnome.org/GnomeScreensaver"
+url="https://wiki.gnome.org/Projects/GnomeScreensaver"
backup=(etc/pam.d/gnome-screensaver)
depends=('dbus-glib' 'libgnomekbd' 'gnome-desktop')
makedepends=('intltool' 'gnome-common')
@@ -18,12 +18,16 @@
gnome-screensaver.pam
move-desktop-file.patch
fix-autoconf.patch
- lock_screen_on_suspend.patch)
+ fix-systemd-support.patch
+ lock_screen_on_suspend.patch
+ lightdm_switch_user.patch)
sha256sums=('f39b78d4f7fed748c7f0a31d694112fb907c6d3c4e63db22eb858df07e962cd0'
'b6ea9e2eb586d94bcabb617a8f1c2958111df87afdbb51f645882bccdc15cbda'
'4bb96f62aa069c83b629204a79a3f63b146bcaf773569aee8b5dd23fbcd88974'
'c4da9c18b543ecbc781c1f103321b324a855bdd0979fd36b437f6033736ad4bb'
- '516c479558576c6c5a2509abfcbf4fdafb5953d252e7a4ab972f9db6137daca8')
+ '8aa387578c1756e573f6558a66be25fc96d7e8567fb7bee580159479841f5f45'
+ '516c479558576c6c5a2509abfcbf4fdafb5953d252e7a4ab972f9db6137daca8'
+ '5d40bd6e1843150912dc52932eaa94c0f6d57931fd45a3769ef40e2335fe3c6f')
prepare() {
cd "$pkgname-$pkgver"
@@ -34,13 +38,18 @@
# Fix build
patch -Np1 -i "$srcdir/fix-autoconf.patch"
+ # Fix systemd support
+ patch -Np1 -i "$srcdir/fix-systemd-support.patch"
+
# Lock screen on suspend with systemd
patch -Np1 -i "$srcdir/lock_screen_on_suspend.patch"
+
+ # Add support for user switch with LightDM
+ patch -Np1 -i "$srcdir/lightdm_switch_user.patch"
}
build() {
cd "$pkgname-$pkgver"
-
autoreconf -fi
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/$pkgname \
--with-mit-ext
Added: fix-systemd-support.patch
===================================================================
--- fix-systemd-support.patch (rev 0)
+++ fix-systemd-support.patch 2013-11-30 20:33:06 UTC (rev 101766)
@@ -0,0 +1,91 @@
+From cac2c0ad8f4f40b6b175b9fbcde06935859f1bbc Mon Sep 17 00:00:00 2001
+From: Peter de Ridder <peter at xfce.org>
+Date: Wed, 20 Mar 2013 20:44:51 +0100
+Subject: [PATCH] Use the session path instead of the session id.
+
+---
+ src/gs-listener-dbus.c | 47 +++++++++++++++++++++++++++--------------------
+ 1 file changed, 27 insertions(+), 20 deletions(-)
+
+diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
+index 703d9e1..11fb95e 100644
+--- a/src/gs-listener-dbus.c
++++ b/src/gs-listener-dbus.c
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <time.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #include <glib/gi18n.h>
+
+@@ -116,19 +117,8 @@ enum {
+ if (listener->priv->session_id == NULL)
+ return FALSE;
+
+-#ifdef WITH_SYSTEMD
+- /* The bus object path is simply the actual session ID
+- * prefixed to make it a bus path */
+- if (listener->priv->have_systemd)
+- return g_str_has_prefix (ssid, SYSTEMD_LOGIND_SESSION_PATH "/")
+- && strcmp (ssid + sizeof (SYSTEMD_LOGIND_SESSION_PATH),
+- listener->priv->session_id) == 0;
+-#endif
+-
+-#ifdef WITH_CONSOLE_KIT
+ if (strcmp (ssid, listener->priv->session_id) == 0)
+ return TRUE;
+-#endif
+
+ return FALSE;
+ }
+@@ -416,20 +406,37 @@ enum {
+
+ #ifdef WITH_SYSTEMD
+ if (listener->priv->have_systemd) {
+- char *t;
+- int r;
++ dbus_uint32_t pid = getpid();
+
+- r = sd_pid_get_session (0, &t);
+- if (r < 0) {
+- gs_debug ("Couldn't determine our own session id: %s", strerror (-r));
++ message = dbus_message_new_method_call (SYSTEMD_LOGIND_SERVICE, SYSTEMD_LOGIND_PATH, SYSTEMD_LOGIND_INTERFACE, "GetSessionByPID");
++ if (message == NULL) {
++ gs_debug ("Couldn't allocate the dbus message");
+ return NULL;
+ }
+
+- /* t is allocated with malloc(), we need it with g_malloc() */
+- ssid = g_strdup(t);
+- free (t);
++ if (dbus_message_append_args (message, DBUS_TYPE_UINT32, &pid, DBUS_TYPE_INVALID) == FALSE) {
++ gs_debug ("Couldn't add args to the dbus message");
++ return NULL;
++ }
++
++ /* FIXME: use async? */
++ reply = dbus_connection_send_with_reply_and_block (listener->priv->system_connection,
++ message,
++ -1, &error);
++ dbus_message_unref (message);
++
++ if (dbus_error_is_set (&error)) {
++ gs_debug ("%s raised:\n %s\n\n", error.name, error.message);
++ dbus_error_free (&error);
++ return NULL;
++ }
++
++ dbus_message_iter_init (reply, &reply_iter);
++ dbus_message_iter_get_basic (&reply_iter, &ssid);
++
++ dbus_message_unref (reply);
+
+- return ssid;
++ return g_strdup (ssid);
+ }
+ #endif
+
+--
+1.8.4
+
Added: lightdm_switch_user.patch
===================================================================
--- lightdm_switch_user.patch (rev 0)
+++ lightdm_switch_user.patch 2013-11-30 20:33:06 UTC (rev 101766)
@@ -0,0 +1,100 @@
+Description: Under lightdm, use dbus to switch to greeter instead of
+ calling gdmflexiserver
+Author: Marc Deslauriers <marc.deslauriers at canonical.com>
+Forwarded: No, upstream uses GDM
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/950583
+
+Index: gnome-screensaver-3.4.2/src/gs-lock-plug.c
+===================================================================
+--- gnome-screensaver-3.4.2.orig/src/gs-lock-plug.c 2012-06-28 10:50:53.955326278 +1200
++++ gnome-screensaver-3.4.2/src/gs-lock-plug.c 2012-06-28 10:50:58.055326137 +1200
+@@ -148,28 +148,60 @@
+ static void
+ do_user_switch (GSLockPlug *plug)
+ {
+- GAppInfo *app;
+- GAppLaunchContext *context;
+- GError *error;
+- char *command;
+-
+- command = g_strdup_printf ("%s %s",
+- GDM_FLEXISERVER_COMMAND,
+- GDM_FLEXISERVER_ARGS);
++ GError *error = NULL;
+
+- error = NULL;
+- context = (GAppLaunchContext*)gdk_app_launch_context_new ();
+- app = g_app_info_create_from_commandline (command, "gdmflexiserver", 0, &error);
+- if (app)
+- g_app_info_launch (app, NULL, context, &error);
+-
+- g_free (command);
+- g_object_unref (context);
+- g_object_unref (app);
++ /* If running under LightDM switch to the greeter using dbus */
++ if (g_getenv("XDG_SEAT_PATH")) {
++ GDBusConnection *bus;
++ GVariant *result = NULL;
++
++ bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
++ if (error)
++ g_warning ("Failed to get system bus: %s", error->message);
++ g_clear_error (&error);
++
++ if (bus)
++ result = g_dbus_connection_call_sync (bus,
++ "org.freedesktop.DisplayManager",
++ g_getenv ("XDG_SEAT_PATH"),
++ "org.freedesktop.DisplayManager.Seat",
++ "SwitchToGreeter",
++ g_variant_new ("()"),
++ G_VARIANT_TYPE ("()"),
++ G_DBUS_CALL_FLAGS_NONE,
++ -1,
++ NULL,
++ &error);
++ if (error)
++ g_warning ("Failed to switch to greeter: %s", error->message);
++ g_clear_error (&error);
+
+- if (error != NULL) {
+- gs_debug ("Unable to start GDM greeter: %s", error->message);
+- g_error_free (error);
++ if (result)
++ g_variant_unref (result);
++ } else {
++
++ GAppInfo *app;
++ GAppLaunchContext *context;
++ char *command;
++
++ command = g_strdup_printf ("%s %s",
++ GDM_FLEXISERVER_COMMAND,
++ GDM_FLEXISERVER_ARGS);
++
++ error = NULL;
++ context = (GAppLaunchContext*)gdk_app_launch_context_new ();
++ app = g_app_info_create_from_commandline (command, "gdmflexiserver", 0, &error);
++ if (app)
++ g_app_info_launch (app, NULL, context, &error);
++
++ g_free (command);
++ g_object_unref (context);
++ g_object_unref (app);
++
++ if (error != NULL) {
++ gs_debug ("Unable to start GDM greeter: %s", error->message);
++ g_error_free (error);
++ }
+ }
+ }
+
+@@ -1026,7 +1058,7 @@
+ if (switch_enabled) {
+ gboolean found;
+ found = is_program_in_path (GDM_FLEXISERVER_COMMAND);
+- if (found) {
++ if (found || g_getenv("XDG_SEAT_PATH")) {
+ gtk_widget_show (plug->priv->auth_switch_button);
+ } else {
+ gs_debug ("Waring: GDM flexiserver command not found: %s", GDM_FLEXISERVER_COMMAND);
More information about the arch-commits
mailing list