diff options
author | Not Zed <NotZed@Ximian.com> | 2005-02-04 10:17:21 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-02-04 10:17:21 +0800 |
commit | 9526b53ea4fc6cd80e0de9f9c70a3c35b33e17e7 (patch) | |
tree | 39bd1c165479fa3d8da3cae37661c1e62e941f9d /mail | |
parent | ded24f2127b72d58eb95a16fb92f98414cd14e9b (diff) | |
download | gsoc2013-evolution-9526b53ea4fc6cd80e0de9f9c70a3c35b33e17e7.tar.gz gsoc2013-evolution-9526b53ea4fc6cd80e0de9f9c70a3c35b33e17e7.tar.zst gsoc2013-evolution-9526b53ea4fc6cd80e0de9f9c70a3c35b33e17e7.zip |
if we aren't waiting for cancel, then don't worry about waiting on the
2005-02-04 Not Zed <NotZed@Ximian.com>
* mail-session.c (alert_user, do_user_message): if we aren't
waiting for cancel, then don't worry about waiting on the reply
port, otherwise we could block when we don't need to, if there is
another window already up.
svn path=/trunk/; revision=28698
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/mail-session.c | 23 |
2 files changed, 20 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 6bf5c13249..51b1b34cfe 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2005-02-04 Not Zed <NotZed@Ximian.com> + + * mail-session.c (alert_user, do_user_message): if we aren't + waiting for cancel, then don't worry about waiting on the reply + port, otherwise we could block when we don't need to, if there is + another window already up. + 2005-02-03 Jeffrey Stedfast <fejj@novell.com> * message-list.c (message_list_set_folder): Use diff --git a/mail/mail-session.c b/mail/mail-session.c index 151f3998b4..3ae114b2cd 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -342,8 +342,7 @@ do_user_message (struct _mail_msg *mm) g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), message_dialog); g_object_weak_ref ((GObject *) message_dialog, (GWeakNotify) user_message_destroy_notify, m); gtk_widget_show ((GtkWidget *) message_dialog); - m->result = TRUE; - e_msgport_reply ((EMsg *)m); + mail_msg_free(m); } } @@ -354,13 +353,14 @@ alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt { MailSession *mail_session = MAIL_SESSION (session); struct _user_message_msg *m, *r; - EMsgPort *user_message_reply; + EMsgPort *user_message_reply = NULL; gboolean ret; if (!mail_session->interactive) return FALSE; - user_message_reply = e_msgport_new (); + if (cancel) + user_message_reply = e_msgport_new (); m = mail_msg_new (&user_message_op, user_message_reply, sizeof (*m)); m->ismain = pthread_self() == mail_gui_thread; m->type = type; @@ -375,13 +375,16 @@ alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt e_msgport_put(mail_gui_port2, (EMsg *)m); } - e_msgport_wait(user_message_reply); - r = (struct _user_message_msg *)e_msgport_get(user_message_reply); - g_assert(m == r); + if (cancel) { + e_msgport_wait(user_message_reply); + r = (struct _user_message_msg *)e_msgport_get(user_message_reply); + g_assert(m == r); - ret = m->result; - mail_msg_free(m); - e_msgport_destroy(user_message_reply); + ret = m->result; + mail_msg_free(m); + e_msgport_destroy(user_message_reply); + } else + ret = TRUE; return ret; } |