summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/dependencies/pinentry/0002-Fix-sigabrt-on-fail-grab-r229.patch
blob: 6162ba58317e38038f27b2a1f7a87cd62763f770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Index: gtk+-2/pinentry-gtk-2.c
===================================================================
--- gtk+-2/pinentry-gtk-2.c (revision 228)
+++ gtk+-2/pinentry-gtk-2.c (revision 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;