[PATCH] pinentry-gtk: Always set the window as transient.

Damien Goutte-Gattat dgouttegattat at incenp.org
Wed Jul 5 11:22:46 CEST 2017


* gtk+-2/pinentry-gtk-2.c (create_window): Setup the make_transient
callback whether we ask for a passphrase or not.
--

Making the window transient seems necessary for (at least some)
tiling window managers to make sure the dialog is floating.

GnuPG-bug-id: T3253
Signed-off-by: Damien Goutte-Gattat <dgouttegattat at incenp.org>
---
 gtk+-2/pinentry-gtk-2.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index dee0360..d467ec5 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -113,9 +113,9 @@ constrain_size (GtkWidget *win, GtkRequisition *req, gpointer data)
 }
 
 
-/* Realize the window as transient if we grab the keyboard.  This
-   makes the window a modal dialog to the root window, which helps the
-   window manager.  See the following quote from:
+/* Realize the window as transient.  This makes the window a modal
+   dialog to the root window, which helps the window manager.
+   See the following quote from:
    https://standards.freedesktop.org/wm-spec/wm-spec-1.4.html#id2512420
 
    Implementing enhanced support for application transient windows
@@ -586,12 +586,12 @@ create_window (pinentry_t ctx)
 #endif
   g_signal_connect (G_OBJECT (win), "size-request",
 		    G_CALLBACK (constrain_size), NULL);
+
+  g_signal_connect (G_OBJECT (win),
+		    "realize", G_CALLBACK (make_transient), NULL);
+
   if (!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",
-- 
2.9.0




More information about the Gnupg-devel mailing list