public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:gnome-next commit in: gnome-extra/gnome-screensaver/files/, gnome-extra/gnome-screensaver/
Date: Wed, 20 Jul 2011 21:02:22 +0000 (UTC)	[thread overview]
Message-ID: <6ada87d8f18ed1e24c2e8db9e77f463d50737c52.tetromino@gentoo> (raw)

commit:     6ada87d8f18ed1e24c2e8db9e77f463d50737c52
Author:     Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
AuthorDate: Wed Jul 20 20:46:43 2011 +0000
Commit:     Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Wed Jul 20 21:02:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=6ada87d8

gnome-extra/gnome-screensaver: 3.0.0 → 3.0.0-r1, fix clock, user switcher

Add an upstream patch for a crash in the user switcher. Add a patch to
fix gnome bug #648145 (the gnome-screensaver clock fails to update after
resuming from suspend).

---
 .../files/gnome-screensaver-3.0.0-ui-timers.patch  |  150 ++++++++++++++++++++
 ...ome-screensaver-3.0.0-user-switcher-crash.patch |   28 ++++
 ....0.ebuild => gnome-screensaver-3.0.0-r1.ebuild} |   10 ++-
 3 files changed, 187 insertions(+), 1 deletions(-)

diff --git a/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-ui-timers.patch b/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-ui-timers.patch
new file mode 100644
index 0000000..759fe7f
--- /dev/null
+++ b/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-ui-timers.patch
@@ -0,0 +1,150 @@
+From 669e23233e8364f5ec7478d938df64d820f4b3cc Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gmail.com>
+Date: Wed, 20 Jul 2011 14:00:43 -0400
+Subject: [PATCH] Add a clock check timer and set watchdog timer in seconds
+ (#648145)
+
+This patch adds two changes:
+* We need a short timer (e.g. 2 seconds) to check that the panel
+  clock has not gotten out of sync with the machine's clock (e.g.
+  when the machine resumes from suspend or hibernate, or if the
+  machine's clock is reset by ntp). Fixes bug #648145.
+* Use 1-second increments for the watchdog timer to save a bit of power.
+---
+ src/gs-window-x11.c |   60 ++++++++++++++++++++++++++++++++++++++++++++------
+ 1 files changed, 52 insertions(+), 8 deletions(-)
+
+diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
+index 5120476..7546627 100644
+--- a/src/gs-window-x11.c
++++ b/src/gs-window-x11.c
+@@ -26,6 +26,7 @@
+ #include <errno.h>
+ #include <sys/wait.h>
+ #include <string.h>
++#include <stdlib.h>
+ 
+ #include <glib/gi18n.h>
+ #include <gtk/gtk.h>
+@@ -100,6 +101,9 @@ struct GSWindowPrivate
+         guint      watchdog_timer_id;
+         guint      info_bar_timer_id;
+         guint      clock_update_id;
++        guint      clock_check_timer_id;
++
++        GDateTime *local_date_time;
+ 
+         gint       lock_pid;
+         gint       lock_watch_id;
+@@ -151,6 +155,9 @@ G_DEFINE_TYPE (GSWindow, gs_window, GTK_TYPE_WINDOW)
+ 
+ static void queue_clock_update (GSWindow *window);
+ 
++static void remove_clock_check_timer (GSWindow *window);
++static void add_clock_check_timer (GSWindow *window);
++
+ static void
+ set_invisible_cursor (GdkWindow *window,
+                       gboolean   invisible)
+@@ -481,9 +488,9 @@ static void
+ add_watchdog_timer (GSWindow *window,
+                     glong     timeout)
+ {
+-        window->priv->watchdog_timer_id = g_timeout_add (timeout,
+-                                                         (GSourceFunc)watchdog_timer,
+-                                                         window);
++        window->priv->watchdog_timer_id = g_timeout_add_seconds (timeout,
++                                                                 (GSourceFunc)watchdog_timer,
++                                                                 window);
+ }
+ 
+ static void
+@@ -671,7 +678,10 @@ gs_window_real_show (GtkWidget *widget)
+         window->priv->timer = g_timer_new ();
+ 
+         remove_watchdog_timer (window);
+-        add_watchdog_timer (window, 30000);
++        add_watchdog_timer (window, 30);
++
++        remove_clock_check_timer (window);
++        add_clock_check_timer (window);
+ 
+         select_popup_events ();
+         window_select_shape_events (window);
+@@ -2191,7 +2201,6 @@ update_clock (GSWindow *window)
+         const char *clock_format;
+         char *text;
+         char *markup;
+-        GDateTime *dt;
+ 
+         /* clock */
+         if (window->priv->clock_format == G_DESKTOP_CLOCK_FORMAT_24H)
+@@ -2201,13 +2210,13 @@ update_clock (GSWindow *window)
+                 /* Translators, this is the 12h date format used in the panel clock */
+                 clock_format = _("%a %l:%M %p");
+ 
+-        dt = g_date_time_new_now_local ();
+-        text = g_date_time_format (dt, clock_format);
++        g_date_time_unref (window->priv->local_date_time);
++        window->priv->local_date_time = g_date_time_new_now_local ();
++        text = g_date_time_format (window->priv->local_date_time, clock_format);
+         markup = g_strdup_printf ("<b><span foreground=\"#ccc\">%s</span></b>", text);
+         gtk_label_set_markup (GTK_LABEL (window->priv->clock), markup);
+         g_free (markup);
+         g_free (text);
+-        g_date_time_unref (dt);
+ }
+ 
+ 
+@@ -2234,6 +2243,38 @@ queue_clock_update (GSWindow *window)
+         window->priv->clock_update_id = g_timeout_add (timeouttime, (GSourceFunc)update_clock_timer, window);
+ }
+ 
++/* check that our clock hasn't gotten out of sync with the machine's clock
++   (e.g. when the machine resumes from suspend or hibernate) */
++static gboolean
++clock_check_timer (GSWindow *window)
++{
++        GDateTime* dt;
++
++        dt = g_date_time_new_now_local ();
++        if (labs(g_date_time_difference(dt, window->priv->local_date_time)) >
++            G_USEC_PER_SEC * 60)
++                update_clock_timer (window);
++        g_date_time_unref (dt);
++        return TRUE;
++}
++
++static void
++remove_clock_check_timer (GSWindow *window)
++{
++        if (window->priv->clock_check_timer_id != 0) {
++                g_source_remove (window->priv->clock_check_timer_id);
++                window->priv->clock_check_timer_id = 0;
++        }
++}
++
++static void
++add_clock_check_timer (GSWindow *window)
++{
++        window->priv->clock_check_timer_id = g_timeout_add_seconds (2,
++                                                                    (GSourceFunc)clock_check_timer,
++                                                                    window);
++}
++
+ static char *
+ get_user_display_name (void)
+ {
+@@ -2448,6 +2489,9 @@ gs_window_finalize (GObject *object)
+ 
+         remove_watchdog_timer (window);
+         remove_popup_dialog_idle (window);
++        remove_clock_check_timer (window);
++
++        g_date_time_unref (window->priv->local_date_time);
+ 
+         if (window->priv->timer) {
+                 g_timer_destroy (window->priv->timer);
+-- 
+1.7.6
+

diff --git a/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-user-switcher-crash.patch b/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-user-switcher-crash.patch
new file mode 100644
index 0000000..bfdea6e
--- /dev/null
+++ b/gnome-extra/gnome-screensaver/files/gnome-screensaver-3.0.0-user-switcher-crash.patch
@@ -0,0 +1,28 @@
+From 338b86c4f0c2cdc4241dbf5cda913f0184afc105 Mon Sep 17 00:00:00 2001
+From: Huzaifa Sidhpurwala <huzaifas@redhat.com>
+Date: Tue, 26 Apr 2011 17:15:56 +0000
+Subject: dialog: Fix crash in user switcher code
+
+The user switch button currently causes the lock dialog to crash
+because of an inverted conditional in the error checking code.
+
+This commit addresses the crash by performing the proper check
+in the conditional.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=648234
+---
+diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
+index 67ab36a..6706fde 100644
+--- a/src/gs-lock-plug.c
++++ b/src/gs-lock-plug.c
+@@ -167,7 +167,7 @@ do_user_switch (GSLockPlug *plug)
+         g_object_unref (context);
+         g_object_unref (app);
+ 
+-        if (!error) {
++        if (error != NULL) {
+                 gs_debug ("Unable to start GDM greeter: %s", error->message);
+                 g_error_free (error);
+         }
+--
+cgit v0.9

diff --git a/gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0.ebuild b/gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0-r1.ebuild
similarity index 86%
rename from gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0.ebuild
rename to gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0-r1.ebuild
index 7c17349..ab6bf7e 100644
--- a/gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0.ebuild
+++ b/gnome-extra/gnome-screensaver/gnome-screensaver-3.0.0-r1.ebuild
@@ -5,7 +5,7 @@
 EAPI="3"
 GCONF_DEBUG="yes"
 
-inherit gnome2
+inherit eutils gnome2
 if [[ ${PV} = 9999 ]]; then
 	inherit gnome2-live
 fi
@@ -69,3 +69,11 @@ pkg_setup() {
 	# xscreensaver and custom screensaver capability removed
 	# poke and inhibit commands were also removed, bug 579430
 }
+
+src_prepare() {
+	# Upstream patch to fix crash in user switcher; will be in next release
+	epatch "${FILESDIR}/${P}-user-switcher-crash.patch"
+
+	# https://bugzilla.gnome.org/show_bug.cgi?id=648145
+	epatch "${FILESDIR}/${PN}-3.0.0-ui-timers.patch"
+}



             reply	other threads:[~2011-07-20 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 21:02 Alexandre Restovtsev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-25 22:50 [gentoo-commits] proj/gnome:gnome-next commit in: gnome-extra/gnome-screensaver/files/, gnome-extra/gnome-screensaver/ Alexandre Restovtsev
2011-08-19  1:16 Alexandre Restovtsev
2011-09-15 13:08 Alexandre Restovtsev
2011-09-28  1:52 Alexandre Restovtsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ada87d8f18ed1e24c2e8db9e77f463d50737c52.tetromino@gentoo \
    --to=tetromino@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox