diff options
author | Not Zed <NotZed@Ximian.com> | 2003-03-18 06:44:58 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-03-18 06:44:58 +0800 |
commit | 42508f7a3ba2e050ddec599740a525d62926bace (patch) | |
tree | aaecfe6034e2ff46539e4b2e7c262ffa0843b507 /mail/mail-callbacks.c | |
parent | 8bc5772286f17dcb7df17ce01ed7b32f83dae454 (diff) | |
download | gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.gz gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.bz2 gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.lz gsoc2013-evolution-42508f7a3ba2e050ddec599740a525d62926bace.tar.xz 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/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 19 |
1 files changed, 17 insertions, 2 deletions
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 |