[balsa/gtk3] Do not use another idle handler to set view-filter



commit 834cb3156d4b3fc482d1d1893c76555f3574980f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Feb 26 18:30:12 2013 -0500

    Do not use another idle handler to set view-filter
    
        * src/main-window.c: do not use another idle handler to set the
        mailbox view-filter.

 ChangeLog         |    5 +++++
 src/main-window.c |   34 ++++++----------------------------
 2 files changed, 11 insertions(+), 28 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 606c5d6..d031d0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-02-26  Peter Bloomfield
 
+       * src/main-window.c: do not use another idle handler to set the
+       mailbox view-filter.
+
+2013-02-26  Peter Bloomfield
+
        Instead of forgetting open mailboxes, do not remember them in
        the first place.
 
diff --git a/src/main-window.c b/src/main-window.c
index 6669516..4474dbc 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -5016,28 +5016,6 @@ bw_size_allocate_cb(GtkWidget * window, GtkAllocation * alloc)
     }
 }
 
-static gboolean
-bw_view_filter_idle(BalsaWindow * window)
-{
-    BalsaIndex *index;
-    LibBalsaMailbox *mailbox;
-    LibBalsaCondition *view_filter;
-
-    index = (BalsaIndex *) window->current_index;
-
-    if (!index)
-        return FALSE;
-
-    mailbox = index->mailbox_node->mailbox;
-    view_filter = bw_get_flag_filter(window);
-    libbalsa_mailbox_set_view_filter(mailbox, view_filter, FALSE);
-    libbalsa_condition_unref(view_filter);
-    libbalsa_mailbox_make_view_filter_persistent(mailbox);
-    g_object_unref(window);
-
-    return FALSE;
-}
-
 /* When page is switched we change the preview window and the selected
    mailbox in the mailbox tree.
  */
@@ -5093,12 +5071,12 @@ bw_notebook_switch_page_cb(GtkWidget * notebook,
     bw_enable_mailbox_menus(window, index);
 
     if (!mailbox->view_filter) {
-        /* Set the view filter in an idle callback; it locks the
-         * mailbox, which means temporarily dropping the gdk lock, and
-         * if we do that in the signal handler it can lead to reentrant
-         * gtk_widget_get_width, which is frowned upon. */
-        gdk_threads_add_idle((GSourceFunc) bw_view_filter_idle,
-                              g_object_ref(window));
+        LibBalsaCondition *view_filter;
+
+        view_filter = bw_get_flag_filter(window);
+        libbalsa_mailbox_set_view_filter(mailbox, view_filter, FALSE);
+        libbalsa_condition_unref(view_filter);
+        libbalsa_mailbox_make_view_filter_persistent(mailbox);
     }
 
     gtk_entry_set_text(GTK_ENTRY(window->sos_entry),


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