[polari] userList: Fix focusing the search entry after room changes



commit 6425e8d337efb9055520a5685bf590d5d08c3363
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jul 30 01:00:16 2015 +0200

    userList: Fix focusing the search entry after room changes
    
    GtkContainer's default focus chain is based on its children's allocated
    y position and height[0]. This is problematic when the user list has just
    been created and doesn't have a proper allocation yet, as it will wrongly
    sort before the search entry in that case.
    Work around this by adding the user list to a dedicated bin (that is kept
    around on room changes) instead of directly to the main box.
    
    [0] https://git.gnome.org/browse/gtk+/tree/gtk/gtkcontainer.c#n2737
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750689

 src/userList.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/userList.js b/src/userList.js
index b7e2ec9..b8fd280 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -52,6 +52,9 @@ const UserListPopover = new Lang.Class({
         this._revealer = new Gtk.Revealer();
         this._box.add(this._revealer);
 
+        this._userListBin = new Gtk.Frame({ shadow_type: Gtk.ShadowType.NONE });
+        this._box.add(this._userListBin);
+
         this._entry = new Gtk.SearchEntry();
         this._entry.connect('search-changed',
                             Lang.bind(this, this._updateFilter));
@@ -86,7 +89,7 @@ const UserListPopover = new Lang.Class({
             return;
 
         this._userList = new UserList(room);
-        this._box.add(this._userList.widget);
+        this._userListBin.add(this._userList.widget);
 
         this._userList.widget.vadjustment.connect('changed',
                                                   Lang.bind(this, this._updateEntryVisibility));


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