fix bug 4239, 'Preferences: Text Options Header Display modal is not modal' (sic)
[claws.git] / src / plugins / pgpcore / passphrase.c
index 4bf424351e0dc00f2230178304dad3bbef578d37..781728b1c262f8fb1d70386fae44405dd3af0047 100644 (file)
@@ -1,5 +1,5 @@
 /* passphrase.c - GTK+ based passphrase callback
- *      Copyright (C) 2001-2013 Werner Koch (dd9jn) and the Claws Mail team
+ * Copyright (C) 2001-2016 Werner Koch (dd9jn) and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -13,7 +13,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -87,6 +86,7 @@ passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad, gi
     gtk_window_set_default_size(GTK_WINDOW(window), 375, 100);
     gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
     gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+    gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
     gtk_window_set_modal(GTK_WINDOW(window), TRUE);
     g_signal_connect(G_OBJECT(window), "delete_event",
                      G_CALLBACK(passphrase_deleted), NULL);
@@ -310,13 +310,13 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint,
         pass = g_strdup(last_pass);
     else {
        gpgmegtk_set_passphrase_grab (prefs_gpg_get_config()->passphrase_grab);
-       debug_print ("%% requesting passphrase for '%s'\n ", uid_hint);
+       debug_print ("%% requesting passphrase for '%s'\n", uid_hint);
        pass = passphrase_mbox (uid_hint, passphrase_hint, prev_bad, FALSE);
        gpgmegtk_free_passphrase();
        if (!pass) {
             debug_print ("%% cancel passphrase entry\n");
             if (write(fd, "\n", 1) != 1)
-               debug_print("short write");
+                               debug_print("short write\n");
 
             return GPG_ERR_CANCELED;
        }
@@ -346,10 +346,10 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint,
     }
 #else
     if (write(fd, pass, strlen(pass)) != strlen(pass))
-       debug_print("Short write");
+               debug_print("short write\n");
 
     if (write(fd, "\n", 1) != 1)
-       debug_print("Short write");
+               debug_print("short write\n");
 #endif
     g_free(pass);