diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-04-15 03:26:32 +0000 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-04-15 03:26:32 +0000 |
commit | ad45d1982b97faa9372d99e51daa687c7c09de7d (patch) | |
tree | af490221f2b733b8f0cf68f3898566d5049c3ab4 /community/cinnamon-screensaver | |
parent | 7c266ff5a9e1f533fd8bd8c2fbbcc05df350dcd3 (diff) |
Tue Apr 15 03:22:01 UTC 2014
Diffstat (limited to 'community/cinnamon-screensaver')
-rw-r--r-- | community/cinnamon-screensaver/PKGBUILD | 24 | ||||
-rw-r--r-- | community/cinnamon-screensaver/away-message-fixes.patch | 226 | ||||
-rw-r--r-- | community/cinnamon-screensaver/fix-systemd-lock.patch | 83 |
3 files changed, 5 insertions, 328 deletions
diff --git a/community/cinnamon-screensaver/PKGBUILD b/community/cinnamon-screensaver/PKGBUILD index a89b7ce9c..c200f601e 100644 --- a/community/cinnamon-screensaver/PKGBUILD +++ b/community/cinnamon-screensaver/PKGBUILD @@ -4,8 +4,8 @@ # Jan de Groot <jgc@archlinux.org> pkgname=cinnamon-screensaver -pkgver=2.0.3 -pkgrel=4 +pkgver=2.2.0 +pkgrel=1 pkgdesc="Screensaver designed to integrate well with the Cinnamon desktop." arch=('i686' 'x86_64') license=('GPL') @@ -14,23 +14,9 @@ backup=(etc/pam.d/cinnamon-screensaver) depends=('cinnamon-desktop' 'cinnamon-translations' 'dbus-glib' 'libgnomekbd') makedepends=('intltool' 'gnome-common') source=($pkgname-$pkgver.tar.gz::https://github.com/linuxmint/cinnamon-screensaver/archive/$pkgver.tar.gz - cinnamon-screensaver.pam - away-message-fixes.patch - fix-systemd-lock.patch) -sha256sums=('00c866e98994afc8939d1d347de631cebaa6ec34ad59646a7ccd223bd757cc7d' - 'b6ea9e2eb586d94bcabb617a8f1c2958111df87afdbb51f645882bccdc15cbda' - 'f9f3d555b0c325322469be765b488da599fc850f8ff5a74f72fdf69f68e04c96' - '14d3301a03883330bf044a40ea4dce74a829b03174833d21efe66ebeb940dc0c') - -prepare() { - cd $pkgname-$pkgver - - # Various fixes for away message handling - patch -Np1 -i ../away-message-fixes.patch - - # Use the session path instead of the session id - patch -Np1 -i ../fix-systemd-lock.patch -} + cinnamon-screensaver.pam) +sha256sums=('2ba075f8bceb5ff853d76b0426e0d3fedcfd503016c4752f1e5b3813b0d8aef9' + 'b6ea9e2eb586d94bcabb617a8f1c2958111df87afdbb51f645882bccdc15cbda') build() { cd $pkgname-$pkgver diff --git a/community/cinnamon-screensaver/away-message-fixes.patch b/community/cinnamon-screensaver/away-message-fixes.patch deleted file mode 100644 index 1828c5beb..000000000 --- a/community/cinnamon-screensaver/away-message-fixes.patch +++ /dev/null @@ -1,226 +0,0 @@ -diff -Naur cinnamon-screensaver-2.0.3.orig/doc/dbus-interface.html cinnamon-screensaver-2.0.3/doc/dbus-interface.html ---- cinnamon-screensaver-2.0.3.orig/doc/dbus-interface.html 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/doc/dbus-interface.html 2013-10-29 10:08:06.568038245 +0100 -@@ -70,7 +70,7 @@ - <code class="literal">Lock</code> - </h3></div></div></div><p> - Request that the screen be locked. -- </p></div><div class="sect2" title="Cycle"><div class="titlepage"><div><div><h3 class="title"><a name="gs-method-Cycle"></a> -+ </p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Direction</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>in</td><td>string</td><td>the away message</td></tr></tbody></table></div></div><div class="sect2" title="Cycle"><div class="titlepage"><div><div><h3 class="title"><a name="gs-method-Cycle"></a> - <code class="literal">Cycle</code> - </h3></div></div></div><p> - Request that the screen saver theme be restarted and, if applicable, -diff -Naur cinnamon-screensaver-2.0.3.orig/src/cinnamon-screensaver-command.c cinnamon-screensaver-2.0.3/src/cinnamon-screensaver-command.c ---- cinnamon-screensaver-2.0.3.orig/src/cinnamon-screensaver-command.c 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/src/cinnamon-screensaver-command.c 2013-10-29 22:32:13.127650887 +0100 -@@ -41,7 +41,7 @@ - static gboolean do_query = FALSE; - static gboolean do_time = FALSE; - --static gchar *away_message = "DEFAULT"; -+static gchar *away_message = ""; - - static GOptionEntry entries [] = { - { "exit", 0, 0, G_OPTION_ARG_NONE, &do_quit, -@@ -114,7 +114,7 @@ - static GDBusMessage * - screensaver_send_message_string (GDBusConnection *connection, - const char *name, -- gboolean value) -+ gchar *value) - { - GDBusMessage *message, *reply; - GError *error; -@@ -310,14 +310,7 @@ - } - - if (do_lock) { -- if (g_strcmp0 (away_message, "DEFAULT") == 0) { -- reply = screensaver_send_message_string (connection, "Lock", away_message); -- } -- else { -- gchar * custom_message = g_strdup_printf("CUSTOM###%s", away_message); -- reply = screensaver_send_message_string (connection, "Lock", custom_message); -- g_free (custom_message); -- } -+ reply = screensaver_send_message_string (connection, "Lock", away_message); - if (reply == NULL) { - g_message ("Did not receive a reply from the screensaver."); - goto done; -diff -Naur cinnamon-screensaver-2.0.3.orig/src/cinnamon-screensaver-dialog.c cinnamon-screensaver-2.0.3/src/cinnamon-screensaver-dialog.c ---- cinnamon-screensaver-2.0.3.orig/src/cinnamon-screensaver-dialog.c 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/src/cinnamon-screensaver-dialog.c 2013-10-29 18:34:38.042752214 +0100 -@@ -49,7 +49,6 @@ - static gboolean enable_logout = FALSE; - static gboolean enable_switch = FALSE; - static char *logout_command = NULL; --static char *away_message = NULL; - - static GOptionEntry entries [] = { - { "verbose", 0, 0, G_OPTION_ARG_NONE, &verbose, -diff -Naur cinnamon-screensaver-2.0.3.orig/src/gs-listener-dbus.c cinnamon-screensaver-2.0.3/src/gs-listener-dbus.c ---- cinnamon-screensaver-2.0.3.orig/src/gs-listener-dbus.c 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/src/gs-listener-dbus.c 2013-10-30 03:04:42.134732524 +0100 -@@ -570,7 +570,7 @@ - if (! dbus_message_get_args (message, &error, - DBUS_TYPE_STRING, &body, - DBUS_TYPE_INVALID)) { -- raise_syntax (connection, message, "ShowMessage"); -+ raise_syntax (connection, message, "Lock"); - return DBUS_HANDLER_RESULT_HANDLED; - } - -@@ -584,6 +584,7 @@ - - return DBUS_HANDLER_RESULT_HANDLED; - } -+ - static DBusHandlerResult - listener_show_message (GSListener *listener, - DBusConnection *connection, -@@ -906,7 +907,7 @@ - } else if (dbus_message_is_signal (message, SYSTEMD_LOGIND_SESSION_INTERFACE, "Lock")) { - if (_listener_message_path_is_our_session (listener, message)) { - gs_debug ("systemd requested session lock"); -- return listener_lock (listener, connection, message); -+ g_signal_emit (listener, signals [LOCK], 0, ""); - } - - return DBUS_HANDLER_RESULT_HANDLED; -@@ -948,7 +949,7 @@ - } else if (dbus_message_is_signal (message, CK_SESSION_INTERFACE, "Lock")) { - if (_listener_message_path_is_our_session (listener, message)) { - gs_debug ("ConsoleKit requested session lock"); -- return listener_lock (listener, connection, message); -+ g_signal_emit (listener, signals [LOCK], 0, ""); - } - - return DBUS_HANDLER_RESULT_HANDLED; -diff -Naur cinnamon-screensaver-2.0.3.orig/src/gs-manager.c cinnamon-screensaver-2.0.3/src/gs-manager.c ---- cinnamon-screensaver-2.0.3.orig/src/gs-manager.c 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/src/gs-manager.c 2013-10-29 20:27:40.394604570 +0100 -@@ -1097,6 +1097,7 @@ - g_object_unref (manager->priv->settings); - } - -+ g_free (manager->priv->away_message); - g_free (manager->priv->logout_command); - g_free (manager->priv->keyboard_command); - -@@ -1261,6 +1262,8 @@ - - gs_manager_destroy_windows (manager); - -+ gs_manager_set_away_message (manager, NULL); -+ - /* reset state */ - manager->priv->active = FALSE; - manager->priv->activate_time = 0; -@@ -1275,10 +1278,18 @@ - gs_manager_set_away_message (GSManager *manager, - const char *message) - { -- g_free (manager->priv->logout_command); -- -- manager->priv->away_message = g_strdup(message); - GSList *l; -+ -+ g_return_if_fail (GS_IS_MANAGER (manager)); -+ -+ g_free (manager->priv->away_message); -+ -+ if (message) { -+ manager->priv->away_message = g_strdup (message); -+ } else { -+ manager->priv->away_message = NULL; -+ } -+ - for (l = manager->priv->windows; l; l = l->next) { - gs_window_set_away_message (l->data, manager->priv->away_message); - } -@@ -1293,7 +1304,6 @@ - if (active) { - res = gs_manager_activate (manager); - } else { -- gs_manager_set_away_message(manager, ""); - res = gs_manager_deactivate (manager); - } - -diff -Naur cinnamon-screensaver-2.0.3.orig/src/gs-window-x11.c cinnamon-screensaver-2.0.3/src/gs-window-x11.c ---- cinnamon-screensaver-2.0.3.orig/src/gs-window-x11.c 2013-10-26 19:34:39.000000000 +0200 -+++ cinnamon-screensaver-2.0.3/src/gs-window-x11.c 2013-10-29 23:11:15.240828725 +0100 -@@ -2132,38 +2132,19 @@ - return utf8_name; - } - --static gchar * --str_replace(const char *string, const char *delimiter, const char *replacement) --{ -- gchar **split; -- gchar *ret; -- g_return_val_if_fail(string != NULL, NULL); -- g_return_val_if_fail(delimiter != NULL, NULL); -- g_return_val_if_fail(replacement != NULL, NULL); -- split = g_strsplit(string, delimiter, 0); -- ret = g_strjoinv(replacement, split); -- g_strfreev(split); -- return ret; --} -- - static void - update_clock (GSWindow *window) - { -- char *markup; -- char *away_message; -- -- if (window->priv->away_message != NULL && g_str_has_prefix (window->priv->away_message, "CUSTOM###") && g_strcmp0(window->priv->away_message, "") != 0) { -- away_message = str_replace(window->priv->away_message, "CUSTOM###", ""); -- markup = g_strdup_printf ("%s\n\n<b><span font_desc=\"Ubuntu 14\" foreground=\"#CCCCCC\"> %s</span></b>\n<b><span font_desc=\"Ubuntu 10\" foreground=\"#ACACAC\"> ~ %s</span></b>", gnome_wall_clock_get_clock (window->priv->clock_tracker), away_message, get_user_display_name()); -- } -- else { -- away_message = g_strdup_printf (_("%s"), window->priv->default_message); -- markup = g_strdup_printf ("%s\n\n<b><span font_desc=\"Ubuntu 14\" foreground=\"#CCCCCC\">%s</span></b>", gnome_wall_clock_get_clock (window->priv->clock_tracker), away_message); -- } -- -- gtk_label_set_markup (GTK_LABEL (window->priv->clock), markup); -- g_free (markup); -- g_free (away_message); -+ char *markup; -+ -+ if (window->priv->away_message != NULL && g_strcmp0(window->priv->away_message, "") != 0) { -+ markup = g_strdup_printf ("%s\n\n<b><span font_desc=\"Ubuntu 14\" foreground=\"#CCCCCC\"> %s</span></b>\n<b><span font_desc=\"Ubuntu 10\" foreground=\"#ACACAC\"> ~ %s</span></b>", gnome_wall_clock_get_clock (window->priv->clock_tracker), g_markup_escape_text(window->priv->away_message, -1), get_user_display_name()); -+ } else { -+ markup = g_strdup_printf ("%s\n\n<b><span font_desc=\"Ubuntu 14\" foreground=\"#CCCCCC\">%s</span></b>", gnome_wall_clock_get_clock (window->priv->clock_tracker), g_markup_escape_text(window->priv->default_message, -1)); -+ } -+ -+ gtk_label_set_markup (GTK_LABEL (window->priv->clock), markup); -+ g_free (markup); - } - - static void -@@ -2197,7 +2178,16 @@ - gs_window_set_away_message (GSWindow *window, - const char *message) - { -- window->priv->away_message = message; -+ g_return_if_fail (GS_IS_WINDOW (window)); -+ -+ g_free (window->priv->away_message); -+ -+ if (message) { -+ window->priv->away_message = g_strdup (message); -+ } else { -+ window->priv->away_message = NULL; -+ } -+ - update_clock (window); - } - -@@ -2320,6 +2310,7 @@ - - g_return_if_fail (window->priv != NULL); - -+ g_free (window->priv->away_message); - g_free (window->priv->logout_command); - g_free (window->priv->keyboard_command); - diff --git a/community/cinnamon-screensaver/fix-systemd-lock.patch b/community/cinnamon-screensaver/fix-systemd-lock.patch deleted file mode 100644 index 7ce3e2394..000000000 --- a/community/cinnamon-screensaver/fix-systemd-lock.patch +++ /dev/null @@ -1,83 +0,0 @@ -From cac2c0ad8f4f40b6b175b9fbcde06935859f1bbc Mon Sep 17 00:00:00 2001 -From: Peter de Ridder <peter@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 -@@ -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 - |