[gnome-shell] NotificationDaemon: create the application proxy asynchronously



commit e1e321d3a77cb3175b7404760ebaf0e8d710f56e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Nov 26 14:59:48 2016 +0100

    NotificationDaemon: create the application proxy asynchronously
    
    Clicking on calendar notifications might block till the DBus request times
    out if the application being poked happens to be non-responsive. Perform
    this asynchronously so we don't block if that is the case.

 js/ui/notificationDaemon.js |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index 9e942b4..120751b 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -702,22 +702,28 @@ const GtkNotificationDaemonAppSource = new Lang.Class({
         return new MessageTray.NotificationApplicationPolicy(this._appId);
     },
 
-    _createApp: function() {
-        return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath);
+    _createApp: function(callback) {
+        return new FdoApplicationProxy(Gio.DBus.session, this._appId, this._objectPath, callback);
     },
 
     activateAction: function(actionId, target) {
-        let app = this._createApp();
-        app.ActivateActionRemote(actionId, target ? [target] : [], getPlatformData());
-
+        this._createApp(function (app, error) {
+            if (error == null)
+                app.ActivateActionRemote(actionId, target ? [target] : [], getPlatformData());
+            else
+                logError(error, 'Failed to activate application proxy');
+        });
         Main.overview.hide();
         Main.panel.closeCalendar();
     },
 
     open: function() {
-        let app = this._createApp();
-        app.ActivateRemote(getPlatformData());
-
+        this._createApp(function (app, error) {
+            if (error == null)
+                app.ActivateRemote(getPlatformData());
+            else
+                logError(error, 'Failed to open application proxy');
+        });
         Main.overview.hide();
         Main.panel.closeCalendar();
     },


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