[polari/wip/fmuellner/misc-fixes: 7/8] app: Present window if appropriate when handling join/query actions
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/misc-fixes: 7/8] app: Present window if appropriate when handling join/query actions
- Date: Thu, 11 Aug 2016 08:43:03 +0000 (UTC)
commit 8a303a1bd80d05a90486e156e60a64968b9f25bb
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 b47d764..7f254f9 100644
--- a/src/application.js
+++ b/src/application.js
@@ -325,6 +325,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]