[pkg-gnupg-maint] Bug#851707: Bug#851707: pinentry-gtk-2 frequently fails to grab the keyboard under awesome
Werner Koch
wk at gnupg.org
Fri Feb 3 11:14:28 UTC 2017
On Thu, 2 Feb 2017 19:29, bernat at debian.org said:
> I am fixing with this patch. Only lightly tested.
FWIW, I forgot to push a fix I had in my local repo. Just did this, put
also not tested. This is basically the same as yours but w/o any delay.
Shalom-Salam,
Werner
commit b0e0bdeac5d40ca645afc9017778b39a26303523
Author: Werner Koch <wk at gnupg.org>
Date: Wed Jan 11 18:40:17 2017 +0100
gtk2: Fix a problem with fvwm
* gtk+-2/pinentry-gtk-2.c (grab_pointer): Take care of
GDK_GRAB_ALREADY_GRABBED.
--
Debian-bug-id: 850708
Co-authored-by: Vincent Lefevre <vincent at vinc17.net>
Signed-off-by: Werner Koch <wk at gnupg.org>
Modified gtk+-2/pinentry-gtk-2.c
diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 473c4aa..e37601f 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -203,7 +203,12 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data)
(void)data;
/* Change the cursor for the duration of the grab to indicate that
- something is going on. */
+ * something is going on. The fvwm window manager grabs the pointer
+ * for a short time and thus we may end up with the already grabbed
+ * error code. Actually this error code should be used to detect a
+ * malicious grabbing application but with fvwm this renders
+ * Pinentry only unusable. Thus we try again several times also for
+ * that error code. See Debian bug 850708 for details. */
/* XXX: It would be nice to have a key cursor, unfortunately there
is none readily available. */
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (win),
@@ -215,7 +220,8 @@ grab_pointer (GtkWidget *win, GdkEvent *event, gpointer data)
NULL /* confine to */,
cursor,
gdk_event_get_time (event));
- while (tries++ < max_tries && err == GDK_GRAB_NOT_VIEWABLE);
+ while (tries++ < max_tries && (err == GDK_GRAB_NOT_VIEWABLE
+ || err == GDK_GRAB_ALREADY_GRABBED));
if (err)
{
--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnupg-maint/attachments/20170203/7b3a8c1f/attachment.sig>
More information about the pkg-gnupg-maint
mailing list