1
diff -Nur -x '*.orig' -x '*~' gnome-screensaver-2.28.0/src/gnome-screensaver-dialog.c gnome-screensaver-2.28.0.new/src/gnome-screensaver-dialog.c
2
--- gnome-screensaver-2.28.0/src/gnome-screensaver-dialog.c 2009-08-26 17:06:12.000000000 +0100
3
+++ gnome-screensaver-2.28.0.new/src/gnome-screensaver-dialog.c 2009-10-16 01:11:24.872719567 +0100
10
#include <glib/gi18n.h>
16
+response_request_quit (void)
18
+ printf ("REQUEST QUIT\n");
24
+quit_timeout_cb (gpointer data)
31
auth_check_idle (GSLockPlug *plug)
36
gs_debug ("Authentication failed, quitting (max failures)");
39
+ /* Don't quit immediately, but rather request that gnome-screensaver
40
+ * terminates us after it has finished the dialog shake. Time out
41
+ * after 5 seconds and quit anyway if this doesn't happen though */
42
+ g_idle_add ((GSourceFunc)response_request_quit, NULL);
43
+ g_timeout_add (5000, (GSourceFunc)quit_timeout_cb, NULL);
52
+signal_handler (int signo)
54
+ if (signo == SIGTERM) {
64
char *nolock_reason = NULL;
65
+ struct sigaction action;
68
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
72
gs_debug_init (verbose, FALSE);
74
+ action.sa_handler = signal_handler;
75
+ sigemptyset (&action.sa_mask);
76
+ action.sa_flags = 0;
78
+ if (sigaction (SIGTERM, &action, NULL) != 0) {
79
+ fprintf (stderr, "Failed to register signal handler");
82
g_idle_add ((GSourceFunc)popup_dialog_idle, NULL);
84
diff -Nur -x '*.orig' -x '*~' gnome-screensaver-2.28.0/src/gs-window-x11.c gnome-screensaver-2.28.0.new/src/gs-window-x11.c
85
--- gnome-screensaver-2.28.0/src/gs-window-x11.c 2009-10-16 01:03:12.262719055 +0100
86
+++ gnome-screensaver-2.28.0.new/src/gs-window-x11.c 2009-10-16 01:03:13.115223457 +0100
91
+ gboolean dialog_quit_requested;
92
+ gboolean dialog_shake_in_progress;
95
gint keyboard_watch_id;
96
@@ -1390,6 +1392,16 @@
97
remove_key_events (window);
101
+maybe_kill_dialog (GSWindow *window)
103
+ if (!window->priv->dialog_shake_in_progress
104
+ && window->priv->dialog_quit_requested
105
+ && window->priv->lock_pid > 0) {
106
+ kill (window->priv->lock_pid, SIGTERM);
110
/* very rudimentary animation for indicating an auth failure */
112
shake_dialog (GSWindow *window)
113
@@ -1398,6 +1410,8 @@
117
+ window->priv->dialog_shake_in_progress = TRUE;
119
for (i = 0; i < 9; i++) {
122
@@ -1422,6 +1436,9 @@
127
+ window->priv->dialog_shake_in_progress = FALSE;
128
+ maybe_kill_dialog (window);
132
@@ -1464,6 +1481,10 @@
133
window->priv->dialog_response = DIALOG_RESPONSE_CANCEL;
136
+ } else if (strstr (line, "REQUEST QUIT") != NULL) {
137
+ gs_debug ("Got request for quit");
138
+ window->priv->dialog_quit_requested = TRUE;
139
+ maybe_kill_dialog (window);
142
case G_IO_STATUS_EOF:
143
@@ -1577,6 +1598,9 @@
145
set_invisible_cursor (GTK_WIDGET (window)->window, FALSE);
147
+ window->priv->dialog_quit_requested = FALSE;
148
+ window->priv->dialog_shake_in_progress = FALSE;
150
result = spawn_on_window (window,
152
&window->priv->lock_pid,