aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-03-18 06:44:58 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-03-18 06:44:58 +0800
commit42508f7a3ba2e050ddec599740a525d62926bace (patch)
treeaaecfe6034e2ff46539e4b2e7c262ffa0843b507 /mail
parent8bc5772286f17dcb7df17ce01ed7b32f83dae454 (diff)
downloadgsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.gz
gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.zst
gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.zip
use a hack to find out if the message-list was focussed before we
2003-03-12 Not Zed <NotZed@Ximian.com> * mail-callbacks.c (expunge_folder): use a hack to find out if the message-list was focussed before we desensitise it. (expunged_folder): If the message-list was focussed before, re-grab the focus. For bug #29564. svn path=/trunk/; revision=20325
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/folder-browser.h3
-rw-r--r--mail/mail-callbacks.c19
3 files changed, 26 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 1c2fad5e4b..11c8791472 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-12 Not Zed <NotZed@Ximian.com>
+
+ * mail-callbacks.c (expunge_folder): use a hack to find out if the
+ message-list was focussed before we desensitise it.
+ (expunged_folder): If the message-list was focussed before,
+ re-grab the focus. For bug #29564.
+
2003-03-17 Ettore Perazzoli <ettore@ximian.com>
* mail-signature-editor.c (mail_signature_editor): Give the editor
diff --git a/mail/folder-browser.h b/mail/folder-browser.h
index 24dd8db0bf..d538003301 100644
--- a/mail/folder-browser.h
+++ b/mail/folder-browser.h
@@ -63,7 +63,8 @@ struct _FolderBrowser {
/* a folder we are expunging, dont use other than to compare the pointer value */
CamelFolder *expunging;
-
+ int expunge_mlfocussed; /* true if the ml was focussed before we expunged */
+
MessageList *message_list;
MailDisplay *mail_display;
GtkWidget *vpaned;
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 6a961e5ef6..3b8267221c 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -2669,6 +2669,12 @@ expunged_folder (CamelFolder *f, void *data)
fb->expunging = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (fb->message_list), TRUE);
+
+ /* FIXME: we should check that the focus hasn't changed in the
+ * mean time, otherwise we steal the focus unecessarily.
+ * Check :get_toplevel()->focus_widget? */
+ if (fb->expunge_mlfocussed)
+ gtk_widget_grab_focus((GtkWidget *)fb->message_list);
}
static gboolean
@@ -2702,8 +2708,17 @@ expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path)
if (fb->folder && (fb->expunging == NULL || fb->folder != fb->expunging) && confirm_expunge (fb)) {
CamelMessageInfo *info;
-
- /* hide the deleted messages so user can't click on them while we expunge */
+ GtkWindow *top;
+ GtkWidget *focus;
+
+ /* disable the message list so user can't click on them while we expunge */
+
+ /* nasty hack to find out if some widget inside the message list is focussed ... */
+ top = gtk_widget_get_toplevel((GtkWidget *)fb->message_list);
+ focus = top?top->focus_widget:NULL;
+ while (focus && focus != (GtkWidget *)fb->message_list)
+ focus = focus->parent;
+ fb->expunge_mlfocussed = focus == (GtkWidget *)fb->message_list;
gtk_widget_set_sensitive (GTK_WIDGET (fb->message_list), FALSE);
/* Only blank the mail display if the message being