diff options
author | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-09-29 20:39:43 +0000 |
---|---|---|
committer | Alejandro Pulver <alepulver@FreeBSD.org> | 2007-09-29 20:39:43 +0000 |
commit | 6709dbfa472a53a7afce23f64dd1e34d7d846680 (patch) | |
tree | 92dc5c08381a848702feb01226a7823c8f4519cd /security/gnome-ssh-askpass | |
parent | 62d6dff9dc75a7e4a4d2c70948842998de510dd8 (diff) |
- Turn off keyboard grabbing to avoid mouse pointer lock after returning from
the screensaver.
PR: ports/103395
Submitted by: Vladimir Grebenschikov <vova@fbsd.ru>
Notes
Notes:
svn path=/head/; revision=200380
Diffstat (limited to 'security/gnome-ssh-askpass')
-rw-r--r-- | security/gnome-ssh-askpass/files/patch-contrib_ssh-askpass2.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/security/gnome-ssh-askpass/files/patch-contrib_ssh-askpass2.c b/security/gnome-ssh-askpass/files/patch-contrib_ssh-askpass2.c new file mode 100644 index 000000000000..3c3f601fd3f3 --- /dev/null +++ b/security/gnome-ssh-askpass/files/patch-contrib_ssh-askpass2.c @@ -0,0 +1,58 @@ +--- contrib/gnome-ssh-askpass2.c.orig Tue Sep 19 09:58:45 2006 ++++ contrib/gnome-ssh-askpass2.c Tue Sep 19 10:03:27 2006 +@@ -88,12 +88,13 @@ + { + const char *failed; + char *passphrase, *local; +- int result, grab_tries, grab_server, grab_pointer; ++ int result, grab_tries, grab_server, grab_pointer, grab_keyboard; + GtkWidget *dialog, *entry; + GdkGrabStatus status; + + grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL); + grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL); ++ grab_keyboard = (getenv("GNOME_SSH_ASKPASS_GRAB_KEYBOARD") != NULL); + grab_tries = 0; + + dialog = gtk_message_dialog_new(NULL, 0, +@@ -135,17 +136,21 @@ + } + } + } +- for(;;) { +- status = gdk_keyboard_grab((GTK_WIDGET(dialog))->window, +- FALSE, GDK_CURRENT_TIME); +- if (status == GDK_GRAB_SUCCESS) +- break; +- usleep(GRAB_WAIT * 1000); +- if (++grab_tries > GRAB_TRIES) { +- failed = "keyboard"; +- goto nograbkb; ++ ++ if (grab_keyboard) { ++ for(;;) { ++ status = gdk_keyboard_grab((GTK_WIDGET(dialog))->window, ++ FALSE, GDK_CURRENT_TIME); ++ if (status == GDK_GRAB_SUCCESS) ++ break; ++ usleep(GRAB_WAIT * 1000); ++ if (++grab_tries > GRAB_TRIES) { ++ failed = "keyboard"; ++ goto nograbkb; ++ } + } + } ++ + if (grab_server) { + gdk_x11_grab_server(); + } +@@ -157,7 +162,8 @@ + XUngrabServer(GDK_DISPLAY()); + if (grab_pointer) + gdk_pointer_ungrab(GDK_CURRENT_TIME); +- gdk_keyboard_ungrab(GDK_CURRENT_TIME); ++ if (grab_keyboard) ++ gdk_keyboard_ungrab(GDK_CURRENT_TIME); + gdk_flush(); + + /* Report passphrase if user selected OK */ |