[Gpg4win-commits] [git] Gpg4win - branch, master, updated. gpg4win-2.2.1-23-g399bddc

by Andre Heinecke cvs at cvs.gnupg.org
Wed Aug 6 16:24:27 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG for Windows".

The branch, master has been updated
       via  399bddc6fe814c0e1ecfeef796871b071f318e05 (commit)
      from  a68caf0af94785a5adc5cee6e3faaa503c5b3ed0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 399bddc6fe814c0e1ecfeef796871b071f318e05
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Aug 6 14:21:59 2014 +0000

    Add recent pinentry-qt commits as patches
    
        * NEWS: Mention pinentry-qt changes
        * patches/pinentry-0.8.4-beta8/
        0002-Use-raiseWindow-also-for-confirm-dialogs.patch,
        patches/pinentry-0.8.4-beta8/
        0003-Add-fallbacks-for-SetForegroundWindow.patch,
        patches/pinentry-0.8.4-beta8/
        0004-Check-for-MOC-also-if-pinentry-qt-is-disabled.patch: New.
    
    --
       All the patches are also commited in the pinentry repository.

diff --git a/NEWS b/NEWS
index 8cbd585..06b9e9d 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,12 @@ Noteworthy changes in version 2.2.2 (unreleased)
 (de) GpgEX stürzt nicht mehr ab wenn die Umgebungsvariable GNUPGHOME gesetzt
      ist.
 
+(en) Pinentry-qt warning and confirmation dialogs should now open in the
+     foreground.
+
+(de) Bestätigungs und Warnmeldungen von pinentry-qt sollten sich nun auch
+     im Vordergrund öffnen.
+
 ~~~~~~~~~~~~~~~
 GnuPG:          2.0.25
 Kleopatra:      2.2.0-gitd95c52d
diff --git a/patches/pinentry-0.8.4-beta8/0002-Use-raiseWindow-also-for-confirm-dialogs.patch b/patches/pinentry-0.8.4-beta8/0002-Use-raiseWindow-also-for-confirm-dialogs.patch
new file mode 100755
index 0000000..6be4a22
--- /dev/null
+++ b/patches/pinentry-0.8.4-beta8/0002-Use-raiseWindow-also-for-confirm-dialogs.patch
@@ -0,0 +1,76 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 47476d2f288a22c29567ae2c179ce0472db4257e Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke at intevation.de>
+Date: Wed, 6 Aug 2014 15:01:54 +0200
+Subject: [PATCH 2/3] Use raiseWindow also for confirm dialogs
+
+    This should fix the case that the dialog opened
+    in the foreground but a warning / confirm dialog
+    opened in the background.
+
+    * qt4/pinentryconfirm.cpp, qt4/pinentryconfirm.h (showEvent):
+    New overwrite base class method to call raiseWindow.
+    * NEWS: Mention this.
+---
+ NEWS                    | 1 +
+ qt4/pinentryconfirm.cpp | 8 ++++++++
+ qt4/pinentryconfirm.h   | 3 +++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/NEWS b/NEWS
+index fbc3708..2741f5c 100644
+--- a/NEWS
++++ b/NEWS
+@@ -5,6 +5,7 @@ Noteworthy changes in version 0.8.4 (unreleased)
+
+  * Qt4: Improved accessiblity
+
++ * Qt4: Raise confirm message windows into foreground
+
+ Noteworthy changes in version 0.8.3 (2013-04-26)
+ ------------------------------------------------
+diff --git a/qt4/pinentryconfirm.cpp b/qt4/pinentryconfirm.cpp
+index f7a1d63..dfbd19f 100644
+--- a/qt4/pinentryconfirm.cpp
++++ b/qt4/pinentryconfirm.cpp
+@@ -18,6 +18,7 @@
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+ #include "pinentryconfirm.h"
++#include "pinentrydialog.h"
+ #include <QAbstractButton>
+
+ PinentryConfirm::PinentryConfirm(Icon icon, int timeout, const QString &title,
+@@ -31,6 +32,13 @@ PinentryConfirm::PinentryConfirm(Icon icon, int timeout, const QString &title,
+     }
+     setAccessibleDescription (desc);
+     setAccessibleName (title);
++    raiseWindow (this);
++}
++
++void PinentryConfirm::showEvent( QShowEvent* event )
++{
++    QDialog::showEvent( event );
++    raiseWindow( this );
+ }
+
+ void PinentryConfirm::slotTimeout()
+diff --git a/qt4/pinentryconfirm.h b/qt4/pinentryconfirm.h
+index 3113750..44fb3ae 100644
+--- a/qt4/pinentryconfirm.h
++++ b/qt4/pinentryconfirm.h
+@@ -36,6 +36,9 @@ class PinentryConfirm : public QMessageBox
+
+     private:
+	QTimer *_timer;
++
++    protected:
++    /* reimp */ void showEvent( QShowEvent* event );
+ };
+
+ #endif
+--
+1.9.1
diff --git a/patches/pinentry-0.8.4-beta8/0003-Add-fallbacks-for-SetForegroundWindow.patch b/patches/pinentry-0.8.4-beta8/0003-Add-fallbacks-for-SetForegroundWindow.patch
new file mode 100755
index 0000000..013e1bd
--- /dev/null
+++ b/patches/pinentry-0.8.4-beta8/0003-Add-fallbacks-for-SetForegroundWindow.patch
@@ -0,0 +1,112 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From f4d14ffcf2e04b1938c00a0ef1504e0e932631fd Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke at intevation.de>
+Date: Wed, 6 Aug 2014 15:05:25 +0200
+Subject: [PATCH 3/3] Add fallbacks for SetForegroundWindow
+
+    If that foreground window fails pinentry-qt now tries to
+    attach to the current foreground process and then tries
+    to set the foreground window again. If that fails it also
+    calls ShowWindow as a last resort.
+
+    * qt4/pinentrydialog.cpp (raiseWindow): Add fallbacks in
+    case SetForegroundWindow fails.
+---
+ NEWS                   |  3 +++
+ qt4/pinentrydialog.cpp | 59 +++++++++++++++++++++++++++++++++-----------------
+ 2 files changed, 42 insertions(+), 20 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 2741f5c..5bd874f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -7,6 +7,9 @@ Noteworthy changes in version 0.8.4 (unreleased)
+
+  * Qt4: Raise confirm message windows into foreground
+
++ * Qt4 (Windows): Improve the way pinentry-qt raises itself in
++ the foreground.
++
+ Noteworthy changes in version 0.8.3 (2013-04-26)
+ ------------------------------------------------
+
+diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp
+index b16a74f..3a6dacc 100644
+--- a/qt4/pinentrydialog.cpp
++++ b/qt4/pinentrydialog.cpp
+@@ -45,31 +45,50 @@
+    versions.  This is the reason why gpg-agent employs its
+    AllowSetForegroundWindow callback machinery to ask the supposed to
+    be be calling process to allow a pinentry to go into the
+-   foreground.  */
+-// #ifdef Q_WS_WIN
+-// void SetForegroundWindowEx( HWND hWnd )
+-// {
+-//    //Attach foreground window thread to our thread
+-//    const DWORD ForeGroundID = GetWindowThreadProcessId(::GetForegroundWindow(),NULL);
+-//    const DWORD CurrentID   = GetCurrentThreadId();
+-
+-//    AttachThreadInput ( ForeGroundID, CurrentID, TRUE );
+-//    //Do our stuff here
+-//    HWND hLastActivePopupWnd = GetLastActivePopup( hWnd );
+-//    SetForegroundWindow( hLastActivePopupWnd );
+-
+-//    //Detach the attached thread
+-//    AttachThreadInput ( ForeGroundID, CurrentID, FALSE );
+-// }// End SetForegroundWindowEx
+-// #endif
++   foreground.
+
+-void raiseWindow( QWidget* w )
+-{
++   [ah] This is a Hack to workaround the fact that Foregrounding
++   a Window is so restricted that it AllowSetForegroundWindow
++   does not always work (e.g. when the ForegroundWindow timeout
++   has not expired.
++   */
+ #ifdef Q_WS_WIN
+-    SetForegroundWindow( w->winId() );
++WINBOOL SetForegroundWindowEx( HWND hWnd )
++{
++   //Attach foreground window thread to our thread
++   const DWORD ForeGroundID = GetWindowThreadProcessId(::GetForegroundWindow(),NULL);
++   const DWORD CurrentID   = GetCurrentThreadId();
++   WINBOOL retval;
++
++   AttachThreadInput ( ForeGroundID, CurrentID, TRUE );
++   //Do our stuff here
++   HWND hLastActivePopupWnd = GetLastActivePopup( hWnd );
++   retval = SetForegroundWindow( hLastActivePopupWnd );
++
++   //Detach the attached thread
++   AttachThreadInput ( ForeGroundID, CurrentID, FALSE );
++   return retval;
++}// End SetForegroundWindowEx
+ #endif
++
++void raiseWindow( QWidget* w )
++{
++    /* Maybe Qt will become agressive enough one day that
++     * this is enough on windows too*/
+     w->raise();
+     w->activateWindow();
++#ifdef Q_WS_WIN
++    /* In the meantime we do our own attention grabbing */
++    if (!SetForegroundWindow (w->winId()) &&
++            !SetForegroundWindowEx (w->winId()))  {
++        OutputDebugString("SetForegroundWindow (ex) failed");
++        /* Yet another fallback which will not work on some
++         * versions and is not recommended by msdn */
++        if (!ShowWindow (w->winId(), SW_SHOWNORMAL)) {
++            OutputDebugString ("ShowWindow failed.");
++        }
++    }
++#endif
+ }
+
+ QPixmap icon( QStyle::StandardPixmap which )
+--
+1.9.1
diff --git a/patches/pinentry-0.8.4-beta8/0004-Check-for-MOC-also-if-pinentry-qt-is-disabled.patch b/patches/pinentry-0.8.4-beta8/0004-Check-for-MOC-also-if-pinentry-qt-is-disabled.patch
new file mode 100755
index 0000000..d4eacea
--- /dev/null
+++ b/patches/pinentry-0.8.4-beta8/0004-Check-for-MOC-also-if-pinentry-qt-is-disabled.patch
@@ -0,0 +1,107 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 52cf95c4fd97dc38856e72aa3e42a135d010df06 Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke at intevation.de>
+Date: Wed, 6 Aug 2014 16:09:55 +0200
+Subject: [PATCH 4/4] Check for MOC also if pinentry-qt is disabled
+
+  * configure.ac: Call QT_PATH_MOC if pinentry_qt4 is not no.
+
+--
+  Previously the MOC lookup from m4/qt.m4 would only be called
+  if pinentry-qt was at least maybe. The MOC variable defined by
+  this macro is also used in pinentry-qt4 though.
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index b4133b0..595c2aa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -427,6 +427,7 @@ fi)
+ fi
+
+ if test "$pinentry_qt4" != "no"; then
++QT_PATH_MOC
+ PKG_CHECK_MODULES(QT4_GUI, QtGui,,
+ if test "$pinentry_qt4" = "yes"; then
+     AC_MSG_ERROR([[
+diff -u a/configure.orig b/configure
+--- a/configure.orig	2014-08-06 14:14:43.887295901 +0000
++++ b/configure	2014-08-06 14:14:53.003225375 +0000
+@@ -11081,6 +11081,72 @@
+
+ if test "$pinentry_qt4" != "no"; then
+
++   qt_bindirs=""
++   for dir in $qt_dirs; do
++      qt_bindirs="$qt_bindirs:$dir/bin:$dir/src/moc"
++   done
++   qt_bindirs="$qt_bindirs:/usr/bin:/usr/X11R6/bin:/usr/local/qt/bin"
++   if test ! "$ac_qt_bindir" = "NO"; then
++      qt_bindirs="$ac_qt_bindir:$qt_bindirs"
++   fi
++
++   # Extract the first word of "moc", so it can be a program name with args.
++set dummy moc; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_path_MOC+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $MOC in
++  [\\/]* | ?:[\\/]*)
++  ac_cv_path_MOC="$MOC" # Let the user override the test with a path.
++  ;;
++  *)
++  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $qt_bindirs
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_path_MOC" && ac_cv_path_MOC="no"
++  ;;
++esac
++fi
++MOC=$ac_cv_path_MOC
++if test -n "$MOC"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5
++$as_echo "$MOC" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++   if test "$MOC" = no; then
++    #AC_MSG_ERROR([No Qt meta object compiler (moc) found!
++    #Please check whether you installed Qt correctly.
++    #You need to have a running moc binary.
++    #configure tried to run $ac_cv_path_moc and the test didn't
++    #succeed. If configure shouldn't have tried this one, set
++    #the environment variable MOC to the right one before running
++    #configure.
++    #])
++    have_moc="no"
++   else
++    have_moc="yes"
++
++   fi
++
++
+ pkg_failed=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for QT4_GUI" >&5
+ $as_echo_n "checking for QT4_GUI... " >&6; }

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                               |    6 ++
 ...-Use-raiseWindow-also-for-confirm-dialogs.patch |   76 +++++++++++++
 ...003-Add-fallbacks-for-SetForegroundWindow.patch |  112 ++++++++++++++++++++
 ...k-for-MOC-also-if-pinentry-qt-is-disabled.patch |  107 +++++++++++++++++++
 4 files changed, 301 insertions(+)
 create mode 100755 patches/pinentry-0.8.4-beta8/0002-Use-raiseWindow-also-for-confirm-dialogs.patch
 create mode 100755 patches/pinentry-0.8.4-beta8/0003-Add-fallbacks-for-SetForegroundWindow.patch
 create mode 100755 patches/pinentry-0.8.4-beta8/0004-Check-for-MOC-also-if-pinentry-qt-is-disabled.patch


hooks/post-receive
-- 
GnuPG for Windows
http://git.gnupg.org



More information about the Gpg4win-commits mailing list