pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/gnome-screensaver Fix crash using Ubuntu patch.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0abb8f5492b1
branches:  trunk
changeset: 567469:0abb8f5492b1
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Wed Nov 18 08:12:12 2009 +0000

description:
Fix crash using Ubuntu patch.
Description:
https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/446395
Solution:
http://patches.ubuntu.com/g/gnome-screensaver/extracted/08_gs_dialog_request_to_exit.patch

Reported by David H. Gutteridge in PR 42338.

diffstat:

 x11/gnome-screensaver/Makefile         |   4 +-
 x11/gnome-screensaver/distinfo         |  10 ++-
 x11/gnome-screensaver/patches/patch-ac |  50 +++++++++++++++++++++++
 x11/gnome-screensaver/patches/patch-ad |  73 ++++++++++++++++++++++++++++++++++
 4 files changed, 132 insertions(+), 5 deletions(-)

diffs (164 lines):

diff -r f78166e7d736 -r 0abb8f5492b1 x11/gnome-screensaver/Makefile
--- a/x11/gnome-screensaver/Makefile    Wed Nov 18 08:11:15 2009 +0000
+++ b/x11/gnome-screensaver/Makefile    Wed Nov 18 08:12:12 2009 +0000
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.38 2009/11/17 17:54:25 wiz Exp $
+# $NetBSD: Makefile,v 1.39 2009/11/18 08:12:12 wiz Exp $
 #
 
 DISTNAME=      gnome-screensaver-2.28.0
+PKGREVISION=   1
 CATEGORIES=    x11 gnome
 MASTER_SITES=  ${MASTER_SITE_GNOME:=sources/gnome-screensaver/2.28/}
+EXTRACT_SUFX=  .tar.bz2
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://live.gnome.org/GnomeScreensaver/
diff -r f78166e7d736 -r 0abb8f5492b1 x11/gnome-screensaver/distinfo
--- a/x11/gnome-screensaver/distinfo    Wed Nov 18 08:11:15 2009 +0000
+++ b/x11/gnome-screensaver/distinfo    Wed Nov 18 08:12:12 2009 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.18 2009/11/17 17:54:25 wiz Exp $
+$NetBSD: distinfo,v 1.19 2009/11/18 08:12:12 wiz Exp $
 
-SHA1 (gnome-screensaver-2.28.0.tar.gz) = 806dc40a28e3380ab94426495b9d626f073c83cb
-RMD160 (gnome-screensaver-2.28.0.tar.gz) = 01a6e3eb38e1dd1e75c71e95b2e420c5022fdfac
-Size (gnome-screensaver-2.28.0.tar.gz) = 5069053 bytes
+SHA1 (gnome-screensaver-2.28.0.tar.bz2) = 7981b09f75076ebb8cd55032696f12ed06b224ca
+RMD160 (gnome-screensaver-2.28.0.tar.bz2) = 3e29efc67cafd66c6aac7c2b4d17b0c2d42b4edb
+Size (gnome-screensaver-2.28.0.tar.bz2) = 4779450 bytes
 SHA1 (patch-aa) = 20f25a4efc3c134366280afbfb8aeb49db791208
 SHA1 (patch-ab) = 5b5f9d69fd071bfd6f9b316626e23585841dad9d
+SHA1 (patch-ac) = 6e7dbae1d0693bf3f20a5e44d2d35c68dbe3ba3f
+SHA1 (patch-ad) = a2b001d143ca7d440c7f22a3f142c8d12e9b17cc
diff -r f78166e7d736 -r 0abb8f5492b1 x11/gnome-screensaver/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-screensaver/patches/patch-ac    Wed Nov 18 08:12:12 2009 +0000
@@ -0,0 +1,50 @@
+$NetBSD: patch-ac,v 1.7 2009/11/18 08:12:12 wiz Exp $
+
+https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/446395
+http://patches.ubuntu.com/g/gnome-screensaver/extracted/08_gs_dialog_request_to_exit.patch
+
+--- src/gnome-screensaver-dialog.c.orig        2009-08-26 16:06:12.000000000 +0000
++++ src/gnome-screensaver-dialog.c
+@@ -29,6 +29,7 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
++#include <signal.h>
+ 
+ #include <glib/gi18n.h>
+ #include <gdk/gdkx.h>
+@@ -326,6 +327,21 @@ response_cb (GSLockPlug *plug,
+ }
+ 
+ static gboolean
++response_request_quit (void)
++{
++        printf ("REQUEST QUIT\n");
++        fflush (stdout);
++        return FALSE;
++}
++
++static gboolean
++quit_timeout_cb (gpointer data)
++{
++        gtk_main_quit ();
++        return FALSE;
++}
++
++static gboolean
+ auth_check_idle (GSLockPlug *plug)
+ {
+         gboolean     res;
+@@ -347,7 +363,11 @@ auth_check_idle (GSLockPlug *plug)
+                 } else {
+                         gs_debug ("Authentication failed, quitting (max failures)");
+                         again = FALSE;
+-                        gtk_main_quit ();
++                        /* Don't quit immediately, but rather request that gnome-screensaver
++                         * terminates us after it has finished the dialog shake. Time out
++                         * after 5 seconds and quit anyway if this doesn't happen though */
++                        g_idle_add ((GSourceFunc)response_request_quit, NULL);
++                        g_timeout_add (5000, (GSourceFunc)quit_timeout_cb, NULL);
+                 }
+         }
+ 
diff -r f78166e7d736 -r 0abb8f5492b1 x11/gnome-screensaver/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-screensaver/patches/patch-ad    Wed Nov 18 08:12:12 2009 +0000
@@ -0,0 +1,73 @@
+$NetBSD: patch-ad,v 1.1 2009/11/18 08:12:12 wiz Exp $
+
+https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/446395
+http://patches.ubuntu.com/g/gnome-screensaver/extracted/08_gs_dialog_request_to_exit.patch
+
+--- src/gs-window-x11.c.orig   2009-08-19 23:19:14.000000000 +0000
++++ src/gs-window-x11.c
+@@ -91,6 +91,8 @@ struct GSWindowPrivate
+         gint       lock_pid;
+         gint       lock_watch_id;
+         gint       dialog_response;
++        gboolean   dialog_quit_requested;
++        gboolean   dialog_shake_in_progress;
+ 
+         gint       keyboard_pid;
+         gint       keyboard_watch_id;
+@@ -1383,6 +1385,16 @@ gs_window_dialog_finish (GSWindow *windo
+         remove_key_events (window);
+ }
+ 
++static void
++maybe_kill_dialog (GSWindow *window)
++{
++        if (!window->priv->dialog_shake_in_progress
++            && window->priv->dialog_quit_requested
++            && window->priv->lock_pid > 0) {
++                kill (window->priv->lock_pid, SIGTERM);
++        }
++}
++
+ /* very rudimentary animation for indicating an auth failure */
+ static void
+ shake_dialog (GSWindow *window)
+@@ -1391,6 +1403,8 @@ shake_dialog (GSWindow *window)
+         guint left;
+         guint right;
+ 
++        window->priv->dialog_shake_in_progress = TRUE;
++
+         for (i = 0; i < 9; i++) {
+                 if (i % 2 == 0) {
+                         left = 30;
+@@ -1415,6 +1429,9 @@ shake_dialog (GSWindow *window)
+ 
+                 g_usleep (10000);
+         }
++
++        window->priv->dialog_shake_in_progress = FALSE;
++        maybe_kill_dialog (window);
+ }
+ 
+ static gboolean
+@@ -1457,6 +1474,10 @@ lock_command_watch (GIOChannel   *source
+                                         window->priv->dialog_response = DIALOG_RESPONSE_CANCEL;
+                                 }
+                                 finished = TRUE;
++                        } else if (strstr (line, "REQUEST QUIT") != NULL) {
++                                gs_debug ("Got request for quit");
++                                window->priv->dialog_quit_requested = TRUE;
++                                maybe_kill_dialog (window);
+                         }
+                         break;
+                 case G_IO_STATUS_EOF:
+@@ -1570,6 +1591,9 @@ popup_dialog_idle (GSWindow *window)
+ 
+         set_invisible_cursor (GTK_WIDGET (window)->window, FALSE);
+ 
++        window->priv->dialog_quit_requested = FALSE;
++        window->priv->dialog_shake_in_progress = FALSE;
++
+         result = spawn_on_window (window,
+                                   command->str,
+                                   &window->priv->lock_pid,



Home | Main Index | Thread Index | Old Index