# pinentry-gtk-2 in FreeBSD-CURRENT



## SaveTheRbtz (Jan 13, 2009)

PH34R# pinentry-gtk-2
OK Your orders please
GETPIN

** ERROR **: could not grab keyboard
aborting...
Abort (core dumped)

pinentry-gtk behaves the same, on the other hand pinentry works fine.

So after looking at source code i've written dirty hack. I not good at writing in C, so use this patch in caution.

`# cd /usr/ports/security/pinentry-gtk2`
`# make patch`
`# patch < somefilename`

```
--- ./work/pinentry-0.7.5/gtk+-2/pinentry-gtk-2.c.orig.0	2009-01-13 07:52:51.000000000 +0300
+++ ./work/pinentry-0.7.5/gtk+-2/pinentry-gtk-2.c	2009-01-13 07:53:19.000000000 +0300
@@ -262,10 +262,10 @@
   if (!confirm_mode)
     {
       g_signal_connect (G_OBJECT (win),
-			pinentry->grab ? "map-event" : "focus-in-event",
+			pinentry->grab ? "expose-event" : "focus-in-event",
 			G_CALLBACK (grab_keyboard), NULL);
       g_signal_connect (G_OBJECT (win),
-			pinentry->grab ? "unmap-event" : "focus-out-event",
+			pinentry->grab ? "no-expose-event" : "focus-out-event",
 			G_CALLBACK (ungrab_keyboard), NULL);
     }
   gtk_window_add_accel_group (GTK_WINDOW (win), acc);
```
`# make deinstall ;; make install`
*
UPD: *Replaced my patch with one from gentoo bugtrack


----------



## cpghost (May 13, 2009)

*Thank you for this patch*

Excellent patch. It fixed the problem here.

You can put this patch in /usr/ports/security/pinentry/files as, say, patch-rab, if you use that port instead of security/pinentry-gtk2 to compile pinentry-gtk-2 binary.


----------

