Skip to content

Instantly share code, notes, and snippets.

@robbat2
Created September 20, 2017 21:04
Show Gist options
  • Select an option

  • Save robbat2/69a43d3a48fa1474012ffcd150dd38ca to your computer and use it in GitHub Desktop.

Select an option

Save robbat2/69a43d3a48fa1474012ffcd150dd38ca to your computer and use it in GitHub Desktop.
app-crypt/pinentry-1.0.0-r2 changes
--- pinentry-1.0.0-r1.ebuild 2017-09-20 13:58:27.939381419 -0700
+++ pinentry-1.0.0-r2.ebuild 2017-09-20 14:03:05.987903619 -0700
@@ -3,7 +3,7 @@
EAPI=6
-inherit autotools flag-o-matic qmake-utils toolchain-funcs
+inherit autotools eutils flag-o-matic qmake-utils toolchain-funcs
DESCRIPTION="Simple passphrase entry dialogs which utilize the Assuan protocol"
HOMEPAGE="https://gnupg.org/aegypten2/index.html"
@@ -50,10 +50,16 @@
PATCHES=(
"${FILESDIR}/${PN}-0.8.2-ncurses.patch"
"${FILESDIR}/${P}-build.patch"
+ "${FILESDIR}/${P}-fvwm.patch"
)
src_prepare() {
default
+ # On loaded but fast systems, with tiling window managers, we need to try
+ # more to get the keyboard.
+ sed -i \
+ -e '/grab_keyboard/,/^}$/{ /max_tries/s,\<4096\>,16*1024,g }' \
+ gtk+-2/pinentry-gtk-2.c
eautoreconf
}
--- /dev/null 2017-08-31 14:54:15.105107031 -0700
+++ files/pinentry-1.0.0-fvwm.patch 2017-02-17 14:09:05.286896965 -0800
@@ -0,0 +1,42 @@
+commit b0e0bdeac5d40ca645afc9017778b39a26303523
+Author: Werner Koch <wk@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@vinc17.net>
+ Signed-off-by: Werner Koch <wk@gnupg.org>
+
+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)
+ {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment