gnome bubbles: Call notifications from the main thread. #1362
Conflicts: SparkleShare/Linux/SparkleBubbles.cs
This commit is contained in:
parent
64aba28c69
commit
b1441ba453
|
@ -34,14 +34,14 @@ namespace SparkleShare {
|
||||||
if (!Program.Controller.NotificationsEnabled)
|
if (!Program.Controller.NotificationsEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
Application.Invoke (delegate {
|
||||||
Notification notification = new Notification () {
|
Notification notification = new Notification () {
|
||||||
Summary = title,
|
Summary = title,
|
||||||
Body = subtext,
|
Body = subtext,
|
||||||
Timeout = 5 * 1000,
|
Timeout = 5 * 1000,
|
||||||
Urgency = Urgency.Low
|
Urgency = Urgency.Low
|
||||||
};
|
};
|
||||||
|
|
||||||
if (image_path != null)
|
if (image_path != null)
|
||||||
notification.Icon = new Gdk.Pixbuf (image_path);
|
notification.Icon = new Gdk.Pixbuf (image_path);
|
||||||
else
|
else
|
||||||
|
@ -52,11 +52,13 @@ namespace SparkleShare {
|
||||||
Controller.BubbleClicked ();
|
Controller.BubbleClicked ();
|
||||||
};
|
};
|
||||||
|
|
||||||
notification.Show ();
|
try {
|
||||||
|
notification.Show ();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
SparkleLogger.LogInfo ("Notification", "Error showing notification: ", e);
|
SparkleLogger.LogInfo ("Notification", "Error showing notification: ", e);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue