[blam] Make sure signals are acted upon on the UI thread
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] Make sure signals are acted upon on the UI thread
- Date: Tue, 18 Jun 2013 16:52:43 +0000 (UTC)
commit a7f6b8551653d16bc6b883e6a25c257d21244a78
Author: Carlos Martín Nieto <cmn dwim me>
Date: Tue Jun 18 15:18:40 2013 +0200
Make sure signals are acted upon on the UI thread
Some signals can be made by background threads doing work, such as
refreshing a feed. Make sure the Gtk signaling happens inside the UI
thread.
src/Application.cs | 3 ++-
src/ChannelList.cs | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/Application.cs b/src/Application.cs
index baab1b5..82123d7 100644
--- a/src/Application.cs
+++ b/src/Application.cs
@@ -145,7 +145,8 @@ namespace Imendio.Blam {
SetupDBus();
Gtk.Application.Init ();
- SynchronizationContext.SetSynchronizationContext(new GLib.GLibSynchronizationContext());
+ Context = new GLib.GLibSynchronizationContext();
+ SynchronizationContext.SetSynchronizationContext(Context);
Proxy.InitProxy ();
diff --git a/src/ChannelList.cs b/src/ChannelList.cs
index 13d1ff7..fb06d17 100644
--- a/src/ChannelList.cs
+++ b/src/ChannelList.cs
@@ -104,7 +104,7 @@ namespace Imendio.Blam {
void CollectionPropertyChanged(object sender, PropertyChangedEventArgs args)
{
- Application.TheApp.UpdateTotalNumberOfUnread();
+ Application.Context.Post(state => Application.TheApp.UpdateTotalNumberOfUnread(),
null);
}
void CollectionChanged(object sender, NotifyCollectionChangedEventArgs args)
@@ -262,7 +262,7 @@ namespace Imendio.Blam {
TreeIter iter = FindChannel (channel);
if (!iter.Equals(TreeIter.Zero)) {
- this.Model.EmitRowChanged (this.Model.GetPath(iter), iter);
+ Application.Context.Post((state) => this.Model.EmitRowChanged
(this.Model.GetPath(iter), iter), null);
}
ForceResort();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]