[banshee] Dap: move gtk calls into the gui thread when creating DapInfoBar



commit b71a6d77413140346452eb03507a2417f1923c0e
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Sat Sep 22 14:44:09 2012 +0100

    Dap: move gtk calls into the gui thread when creating DapInfoBar
    
    Place the creation of DapInfoBar a bit later in DapSource::Initialize(),
    where there is another ThreadAssist.ProxyToMain() call for the creation
    of the DapContent object, so we reuse the proxy operation for the call
    to both constructors.
    
    Before this change, lots of gtk calls were reported by gui-thread-check, such as:
    
    *** GTK CALL NOT IN GUI THREAD: Widget.gtk_widget_queue_draw
       Widget.QueueDraw
       SegmentedBar.UpdateSegment
       DapInfoBar.UpdateUsage
       DapInfoBar.BuildWidget
       DapInfoBar..ctor
       DapSource.Initialize
       MassStorageSource.DeviceInitialize
       DapService.FindDeviceSource
       MapDeviceJob.Run
       Scheduler.ProcessJobThread
       Thread.StartInternal
    
    *** GTK CALL NOT IN GUI THREAD: Box.gtk_box_pack_start
       Box.PackStart
       DapInfoBar.BuildWidget
       DapInfoBar..ctor
       DapSource.Initialize
       MassStorageSource.DeviceInitialize
       DapService.FindDeviceSource
       MapDeviceJob.Run
       Scheduler.ProcessJobThread
       Thread.StartInternal

 src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
index 6b5c969..02492d5 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
@@ -186,8 +186,6 @@ namespace Banshee.Dap
             Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");
 
             sync = new DapSync (this);
-            dap_info_bar = new DapInfoBar (this);
-            Properties.Set<Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar);
 
             /*dap_properties_display = new DapPropertiesDisplay (this);
             Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", dap_properties_display);*/
@@ -227,6 +225,9 @@ namespace Banshee.Dap
             BuildPreferences ();
 
             ThreadAssist.ProxyToMain (delegate {
+                dap_info_bar = new DapInfoBar (this);
+                Properties.Set<Gtk.Widget> ("Nereid.SourceContents.FooterWidget", dap_info_bar);
+
                 Properties.Set<Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new DapContent (this));
             });
         }



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