[gnome-shell/gnome-3-34] switcherPopup: Fix scrollable check



commit a7b0e96304de592c9632f0790c5bb6b87ad5b894
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Nov 29 00:11:16 2019 +0000

    switcherPopup: Fix scrollable check
    
    When commit c6cea277e replaced Shell.GenericContainer, the check
    whether the required width exceeds the avilable width was changed
    from using the minimum widths of items to the natural width of the
    scroll view.
    
    That doesn't work correctly, as the *natural* width may well exceed
    the actually used width: SwitcherList bases its width request on
    children's minimum sizes to force labels to ellipsize.
    
    Fix this by using the minimum width of the scroll view's child instead.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1834
    
    
    (cherry picked from commit 867cffaf2093dbf3cad178356ea4716f02334073)

 js/ui/switcherPopup.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index 975e83d2c2..96c85df381 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -568,10 +568,10 @@ var SwitcherList = GObject.registerClass({
         let leftPadding = this.get_theme_node().get_padding(St.Side.LEFT);
         let rightPadding = this.get_theme_node().get_padding(St.Side.RIGHT);
 
-        let [, natScrollViewWidth] = this._scrollView.get_preferred_width(height);
+        let [minListWidth] = this._list.get_preferred_width(height);
 
         let childBox = new Clutter.ActorBox();
-        let scrollable = natScrollViewWidth > width;
+        let scrollable = minListWidth > width;
 
         this._scrollView.allocate(contentBox, flags);
 


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