[polari/wip/fmuellner/misc-fixes: 8/9] app: Present window if appropriate when handling join/query actions



commit 08a724ef9894838ecdef9c75c96c394635a07a61
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Jul 30 23:01:31 2016 +0200

    app: Present window if appropriate when handling join/query actions
    
    When we are launched through an action, it is on us to present a window
    if the action requires it. Joining a room or switching to it doesn't make
    much sense if we don't display it anywhere, so ensure we have a window
    and present it if appropriate.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769592

 src/application.js     |    5 +++++
 src/chatroomManager.js |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index ed90d93..bf4f049 100644
--- a/src/application.js
+++ b/src/application.js
@@ -323,6 +323,11 @@ const Application = new Lang.Class({
     },
 
     _requestChannel: function(accountPath, targetType, targetId, time, callback) {
+        let [present, ] = Tp.user_action_time_should_present(time);
+
+        if (!this._window || present)
+            this.activate();
+
         let account = this._accountsMonitor.lookupAccount(accountPath);
 
         if (!account || !account.enabled) {
diff --git a/src/chatroomManager.js b/src/chatroomManager.js
index 2d14466..653b3d2 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -428,9 +428,6 @@ const _ChatroomManager = new Lang.Class({
                     return;
                 }
 
-                if (!this._app.get_active_window())
-                    this._app.activate();
-
                 let room = this._ensureRoomForChannel(channel);
                 //channel.join_async('', null);
 


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