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.
73 lines
2.6 KiB
Text
73 lines
2.6 KiB
Text
$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,
|