[evolution] mail-session: Use the shell's active window as parent for dialog



commit 73b7238f07ec0f932bb7666f38d46aa282eac8da
Author: Rob Bradford <rob linux intel com>
Date:   Mon Aug 2 16:51:31 2010 +0100

    mail-session: Use the shell's active window as parent for dialog
    
    This means that when the mail session generates an EAlertDialog e.g. for SSL
    certificate validity we can provide a parent window for the dialog.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=625846

 mail/mail-session.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/mail/mail-session.c b/mail/mail-session.c
index d55ef61..f120d2f 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -344,6 +344,7 @@ user_message_response (GtkDialog *dialog, gint button, struct _user_message_msg
 static void
 user_message_exec (struct _user_message_msg *m)
 {
+	GtkWindow *parent;
 	const gchar *error_type;
 
 	if (!m->ismain && user_message_dialog != NULL) {
@@ -372,10 +373,10 @@ user_message_exec (struct _user_message_msg *m)
 			g_return_if_reached ();
 	}
 
-	/* The mail daemon won't have a window here, so there's nothing to set
-	 * as the parent */
+	/* Pull in the active window from the shell to get a parent window */
+	parent = e_shell_get_active_window (e_shell_get_default ());
 	user_message_dialog =
-		e_alert_dialog_new_for_args (NULL, error_type, m->prompt, NULL);
+		e_alert_dialog_new_for_args (parent, error_type, m->prompt, NULL);
 	g_object_set (
 		user_message_dialog, "allow_shrink", TRUE,
 		"allow_grow", TRUE, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]