Updated to latest upstream version (0.8.1)

This commit is contained in:
Stanislav Ochotnicky 2011-02-01 14:51:25 +01:00
parent b32a462e3e
commit c59c39a528
7 changed files with 22 additions and 105 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
pinentry-0.8.0.tar.gz pinentry-0.8.0.tar.gz
pinentry-0.8.0.tar.gz.sig pinentry-0.8.0.tar.gz.sig
/pinentry-0.8.1.tar.gz
/pinentry-0.8.1.tar.gz.sig

View File

@ -1,32 +0,0 @@
From 977d49018cebcc37d0b667713ad422f80ba9c8d2 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Fri, 16 Apr 2010 16:17:04 +0200
Subject: [PATCH] Fix pinentry-gtk-2 SIGSEGV when unfocusing with -g argument
gdk_window_set_transient_for cannot be used with parent = 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=520236
---
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, gpointer 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"));
}
--
1.6.6.1

View File

@ -1,19 +1,22 @@
From 0cc3dd71213687ccb5ec0a1866864558bf03260b Mon Sep 17 00:00:00 2001 From c2ab12b3742c929a225c3753439438edc27bfa81 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com> From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Fri, 7 May 2010 14:45:44 +0200 Date: Tue, 1 Feb 2011 14:42:27 +0100
Subject: [PATCH] Fix qt4 pinentry window created in the background Subject: [PATCH] Fix qt4 pinentry window created in the background
This is probably just a workaround. Proper fix is being investigated. This is probably just a workaround. Proper fix is being investigated.
See:
https://bugzilla.redhat.com/show_bug.cgi?id=589532
http://stackoverflow.com/questions/2788518/calling-activatewindow-on-qdialog-sends-window-to-background
--- ---
qt4/pinentrydialog.cpp | 1 - qt4/pinentrydialog.cpp | 1 -
1 files changed, 0 insertions(+), 1 deletions(-) 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp
index 8644136..6064ab9 100644 index 541baf4..d634eb6 100644
--- a/qt4/pinentrydialog.cpp --- a/qt4/pinentrydialog.cpp
+++ b/qt4/pinentrydialog.cpp +++ b/qt4/pinentrydialog.cpp
@@ -63,7 +63,6 @@ void raiseWindow( QWidget* w ) @@ -69,7 +69,6 @@ void raiseWindow( QWidget* w )
SetForegroundWindowEx( w->winId() ); SetForegroundWindow( w->winId() );
#endif #endif
w->raise(); w->raise();
- w->activateWindow(); - w->activateWindow();
@ -21,5 +24,5 @@ index 8644136..6064ab9 100644
QPixmap icon( QStyle::StandardPixmap which ) QPixmap icon( QStyle::StandardPixmap which )
-- --
1.6.6.1 1.7.3.5

View File

@ -1,34 +0,0 @@
Index: gtk+-2/pinentry-gtk-2.c
===================================================================
--- gtk+-2/pinentry-gtk-2.c (revision 228)
+++ gtk+-2/pinentry-gtk-2.c (revision 229)
@@ -52,6 +52,7 @@
#endif
static pinentry_t pinentry;
+static int grab_failed;
static int passphrase_ok;
typedef enum { CONFIRM_CANCEL, CONFIRM_OK, CONFIRM_NOTOK } confirm_value_t;
static confirm_value_t confirm_value;
@@ -135,7 +136,11 @@
return;
if (gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)))
- g_error ("could not grab keyboard");
+ {
+ g_critical ("could not grab keyboard");
+ grab_failed = 1;
+ gtk_main_quit ();
+ }
}
@@ -520,7 +525,7 @@
while (gtk_events_pending ())
gtk_main_iteration ();
- if (confirm_value == CONFIRM_CANCEL)
+ if (confirm_value == CONFIRM_CANCEL || grab_failed)
pe->canceled = 1;
pinentry = NULL;

View File

@ -1,17 +0,0 @@
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",

View File

@ -16,8 +16,8 @@
%endif %endif
Name: pinentry Name: pinentry
Version: 0.8.0 Version: 0.8.1
Release: 3%{?dist} Release: 1%{?dist}
Summary: Collection of simple PIN or passphrase entry dialogs Summary: Collection of simple PIN or passphrase entry dialogs
Group: Applications/System Group: Applications/System
@ -30,13 +30,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# borrowed from opensuse # borrowed from opensuse
Source10: pinentry-wrapper Source10: pinentry-wrapper
## Backported patches from SVN
Patch50: 0001-Fix-pinentry-gtk-2-SIGSEGV-when-unfocusing-with-g-ar.patch
Patch51: 0002-Fix-sigabrt-on-fail-grab-r229.patch
Patch52: 0003-pinentry-gtk-x11-race.patch
## Patches not yet in SVN ## Patches not yet in SVN
Patch53: 0004-Fix-qt4-pinentry-window-created-in-the-background.patch Patch53: 0001-Fix-qt4-pinentry-window-created-in-the-background.patch
BuildRequires: gtk2-devel BuildRequires: gtk2-devel
BuildRequires: libcap-devel BuildRequires: libcap-devel
@ -102,9 +97,6 @@ Support for Qt4 is new, and a bit experimental.
%prep %prep
%setup -q %setup -q
%patch50 -p1 -b .rhbug_520236
%patch51 -p0 -b .rhbug_585422
%patch52 -p1 -b .rhbug_589998
%patch53 -p1 -b .rhbug_589532 %patch53 -p1 -b .rhbug_589532
# hack around auto* madness, lack of proper support for moc # hack around auto* madness, lack of proper support for moc
@ -196,6 +188,9 @@ fi
%changelog %changelog
* Tue Feb 1 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.8.1-1
- Updated to latest upstream version (0.8.1)
* Fri May 7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.8.0-3 * Fri May 7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.8.0-3
- Fix X11 even race with gtk (#589998) - Fix X11 even race with gtk (#589998)
- Fix qt4 problems with creating window in the background (#589532) - Fix qt4 problems with creating window in the background (#589532)

View File

@ -1,2 +1,2 @@
590be1b00f9ab63205843c7fed8caf35 pinentry-0.8.0.tar.gz 81f99904daee5331eb6738408bb024b6 pinentry-0.8.1.tar.gz
12467655a6ba5188c5204f2fbe7f4015 pinentry-0.8.0.tar.gz.sig defb44904ff18f793b3782baf92ee91c pinentry-0.8.1.tar.gz.sig