[svn] pinentry - r229 - in trunk: . gtk+-2
svn author wk
cvs at cvs.gnupg.org
Mon Apr 26 19:37:28 CEST 2010
Author: wk
Date: 2010-04-26 19:37:27 +0200 (Mon, 26 Apr 2010)
New Revision: 229
Modified:
trunk/ChangeLog
trunk/gtk+-2/pinentry-gtk-2.c
Log:
Do not use g_error but return cancel.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-04-20 14:37:05 UTC (rev 228)
+++ trunk/ChangeLog 2010-04-26 17:37:27 UTC (rev 229)
@@ -1,3 +1,9 @@
+2010-04-26 Werner Koch <wk at g10code.com>
+
+ * gtk+-2/pinentry-gtk-2.c (grab_failed): New.
+ (grab_keyboard): s/g_error/g_critical/. Set GRAB_FAILED.
+ (gtk_cmd_handler): Return Cancel if a grab failed.
+
2010-04-20 Marcus Brinkmann <marcus at g10code.de>
* pinentry/pinentry.c: Move include config.h to top!
Modified: trunk/gtk+-2/pinentry-gtk-2.c
===================================================================
--- trunk/gtk+-2/pinentry-gtk-2.c 2010-04-20 14:37:05 UTC (rev 228)
+++ trunk/gtk+-2/pinentry-gtk-2.c 2010-04-26 17:37:27 UTC (rev 229)
@@ -52,6 +52,7 @@
#endif
static pinentry_t pinentry;
+static int grab_failed;
static int passphrase_ok;
typedef enum { CONFIRM_CANCEL, CONFIRM_OK, CONFIRM_NOTOK } confirm_value_t;
static confirm_value_t confirm_value;
@@ -135,7 +136,11 @@
return;
if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)))
- g_error ("could not grab keyboard");
+ {
+ g_critical ("could not grab keyboard");
+ grab_failed = 1;
+ gtk_main_quit ();
+ }
}
@@ -520,7 +525,7 @@
while (gtk_events_pending ())
gtk_main_iteration ();
- if (confirm_value == CONFIRM_CANCEL)
+ if (confirm_value == CONFIRM_CANCEL || grab_failed)
pe->canceled = 1;
pinentry = NULL;
More information about the Gnupg-commits
mailing list