update Thu Feb 11 00:37:00 PST 2010
[pkgsrc.git] / x11 / gnome-screensaver / patches / patch-ac
1 $NetBSD: patch-ac,v 1.7 2009/11/18 08:12:12 wiz Exp $
2
3 https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/446395
4 http://patches.ubuntu.com/g/gnome-screensaver/extracted/08_gs_dialog_request_to_exit.patch
5
6 --- src/gnome-screensaver-dialog.c.orig 2009-08-26 16:06:12.000000000 +0000
7 +++ src/gnome-screensaver-dialog.c
8 @@ -29,6 +29,7 @@
9  #include <sys/types.h>
10  #include <sys/wait.h>
11  #include <unistd.h>
12 +#include <signal.h>
13  
14  #include <glib/gi18n.h>
15  #include <gdk/gdkx.h>
16 @@ -326,6 +327,21 @@ response_cb (GSLockPlug *plug,
17  }
18  
19  static gboolean
20 +response_request_quit (void)
21 +{
22 +        printf ("REQUEST QUIT\n");
23 +        fflush (stdout);
24 +        return FALSE;
25 +}
26 +
27 +static gboolean
28 +quit_timeout_cb (gpointer data)
29 +{
30 +        gtk_main_quit ();
31 +        return FALSE;
32 +}
33 +
34 +static gboolean
35  auth_check_idle (GSLockPlug *plug)
36  {
37          gboolean     res;
38 @@ -347,7 +363,11 @@ auth_check_idle (GSLockPlug *plug)
39                  } else {
40                          gs_debug ("Authentication failed, quitting (max failures)");
41                          again = FALSE;
42 -                        gtk_main_quit ();
43 +                        /* Don't quit immediately, but rather request that gnome-screensaver
44 +                         * terminates us after it has finished the dialog shake. Time out
45 +                         * after 5 seconds and quit anyway if this doesn't happen though */
46 +                        g_idle_add ((GSourceFunc)response_request_quit, NULL);
47 +                        g_timeout_add (5000, (GSourceFunc)quit_timeout_cb, NULL);
48                  }
49          }
50