[polari] entryArea: Ensure only the mapped chat entry has a completion list



commit 00aedc172b85e9325835eaca1b90e9f8fc17601e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Sep 24 14:59:51 2014 +0200

    entryArea: Ensure only the mapped chat entry has a completion list
    
    Otherwise tab completion lists are maintained for every room
    simultaneously, rocketing the amount of widgets as userlist changes
    happen in any of the active rooms.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732290

 src/entryArea.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 9fc5f15..63e4875 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -33,6 +33,9 @@ const EntryArea = new Lang.Class({
             this._room.connect('notify::channel',
                                Lang.bind(this, this._onChannelChanged));
         this._onChannelChanged(room);
+
+        this._entry.connect('map', Lang.bind(this, this._updateCompletions));
+        this._entry.connect('unmap', Lang.bind(this, this._updateCompletions));
     },
 
     _createWidget: function() {
@@ -92,7 +95,8 @@ const EntryArea = new Lang.Class({
     _updateCompletions: function() {
         let nicks = [];
 
-        if (this._room &&
+        if (this._entry.get_mapped() &&
+            this._room &&
             this._room.channel &&
             this._room.channel.has_interface(Tp.IFACE_CHANNEL_INTERFACE_GROUP)) {
             let members = this._room.channel.group_dup_members_contacts();


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