[balsa/gtk3] Use idle callback only from a subthread



commit 6b9dc834be037fd03a79f333acd3fc264a0e4c8d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Nov 27 22:06:22 2012 -0500

    Use idle callback only from a subthread
    
    	* src/balsa-index.c (balsa_index_scroll_on_open): use idle
    	callback only from a subthread.

 ChangeLog         |    5 +++++
 src/balsa-index.c |    5 ++++-
 2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7921aca..92604e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-27  Peter Bloomfield
+
+	* src/balsa-index.c (balsa_index_scroll_on_open): use idle
+	callback only from a subthread.
+
 2012-11-21  Peter Bloomfield
 
 	Build with gtk 3.6, at least without threads
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 79365c4..3d3ead1 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -927,7 +927,10 @@ balsa_index_scroll_on_open(BalsaIndex *index)
     data->path = path;
     data->select = (view_on_open && GPOINTER_TO_INT(view_on_open))
         || balsa_app.view_message_on_open;
-    gdk_threads_add_idle((GSourceFunc)bi_view_on_open, data);
+    if (libbalsa_am_i_subthread())
+        gdk_threads_add_idle((GSourceFunc)bi_view_on_open, data);
+    else
+        bi_view_on_open(data);
 }
 
 static LibBalsaCondition *cond_undeleted;



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