[PATCH] Fix pinentry-gtk-2 SIGSEGV when unfocusing with -g argument

Stanislav Ochotnicky <[email protected]> Fri, 16 Apr 2010 16:45:22 +0200
Newsgroups gmane.comp.encryption.gpg.gpa.devel
Organization Red Hat
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1537171059==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig1AA7ED72E2675B06B31C0355"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig1AA7ED72E2675B06B31C0355
Content-Type: multipart/mixed; boundary="------------070905070304090609090204"

This is a multi-part message in MIME format.
--------------070905070304090609090204
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi everyone,

I am including a fix for pinentry-gtk-2 SIGSEGV bug when using
--no-global-grab option.

gdk_window_set_transient_for cannot be used with parent =3D NULL to
unset transient hint (unlike gtk_ version which can). Replacement
code is taken from gtk_window_transient_parent_unrealized

Applied cleanly at least over 0.8.0 and 0.7.6

More info see: https://bugzilla.redhat.com/show_bug.cgi?id=3D520236


--=20
Stanislav Ochotnicky <[email protected]>
Associate Software Engineer - Base Operating Systems Brno

Mobile: +420 775 633 759
Red Hat Inc.                               http://cz.redhat.com


--------------070905070304090609090204
Content-Type: text/plain;
	name="0001-Fix-pinentry-gtk-2-SIGSEGV-when-unfocusing-with-g-ar.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename*0="0001-Fix-pinentry-gtk-2-SIGSEGV-when-unfocusing-with-g-ar.pa";
	filename*1="tch"

=46rom 977d49018cebcc37d0b667713ad422f80ba9c8d2 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <[email protected]>
Date: Fri, 16 Apr 2010 16:17:04 +0200
Subject: [PATCH] Fix pinentry-gtk-2 SIGSEGV when unfocusing with -g argum=
ent

gdk_window_set_transient_for cannot be used with parent =3D NULL to
unset transient hint (unlike gtk_ version which can). Replacement
code is taken from gtk_window_transient_parent_unrealized

Applied cleanly at least over 0.8.0 and 0.7.6

More info see: https://bugzilla.redhat.com/show_bug.cgi?id=3D520236
---
 gtk+-2/pinentry-gtk-2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 7cd7616..fdd5822 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -145,7 +145,8 @@ ungrab_keyboard (GtkWidget *win, GdkEvent *event, gpo=
inter data)
 {
   gdk_keyboard_ungrab (gdk_event_get_time (event));
   /* Unmake window transient for the root window.  */
-  gdk_window_set_transient_for (win->window, NULL);
+  gdk_property_delete (win->window,
+                       gdk_atom_intern_static_string ("WM_TRANSIENT_FOR"=
));
 }
=20
=20
--=20
1.6.6.1


--------------070905070304090609090204--

--------------enig1AA7ED72E2675B06B31C0355
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkvIeAQACgkQB9Uc/HGhZ3xEVgCeIRaQd9omJUOcdlxeSWZNJBIE
Ly0AniNVMjcppZBZ+TjZ4Wq1PxcUNcSp
=jj8U
-----END PGP SIGNATURE-----

--------------enig1AA7ED72E2675B06B31C0355--


--===============1537171059==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gpa-dev mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gpa-dev

--===============1537171059==--