18 lines
823 B
Diff
18 lines
823 B
Diff
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
|
|
index 2bf920b..658161c 100644
|
|
--- a/gtk+-2/pinentry-gtk-2.c
|
|
+++ b/gtk+-2/pinentry-gtk-2.c
|
|
@@ -305,9 +309,11 @@ create_window (int confirm_mode)
|
|
if (pinentry->grab)
|
|
g_signal_connect (G_OBJECT (win),
|
|
"realize", G_CALLBACK (make_transient), NULL);
|
|
+ //we need to grab the keyboard when its visible! not when its mapped (there is a difference)
|
|
+ g_object_set(G_OBJECT(win), "events", GDK_VISIBILITY_NOTIFY_MASK | GDK_STRUCTURE_MASK, NULL);
|
|
|
|
g_signal_connect (G_OBJECT (win),
|
|
- pinentry->grab ? "map-event" : "focus-in-event",
|
|
+ pinentry->grab ? "visibility-notify-event" : "focus-in-event",
|
|
G_CALLBACK (grab_keyboard), NULL);
|
|
g_signal_connect (G_OBJECT (win),
|
|
pinentry->grab ? "unmap-event" : "focus-out-event",
|