[gnome-shell/wip/rstrode/login-screen-extensions: 24/134] shellEntry: Restore natural-height-set instead of forcing it




commit 1ed3d5df032da35c76ca1c8d87544d17ffcbb994
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 21 19:38:53 2020 +0100

    shellEntry: Restore natural-height-set instead of forcing it
    
    If we are transitioning the label from 0 to its natural height, we
    must set natural-height-set again after querying the preferred height,
    otherwise Clutter would skip the transition.
    
    However when transitioning in the opposite direction, setting the
    property to true can go horribly wrong:
    If the actor hasn't been allocated before, it will store a fixed
    natural height of 0. But as there is no fixed min-height, we can
    end up with min-height > natural-height, which is a fatal error.
    
    (This isn't an issue when *actually* setting a fixed height, as
    that will set both natural and minimum height)
    
    So instead of always setting natural-height-set to true, restore
    its previous value to fix the issue.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2255

 js/ui/shellEntry.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
index 55267e7c87..4a30b22f7a 100644
--- a/js/ui/shellEntry.js
+++ b/js/ui/shellEntry.js
@@ -209,9 +209,10 @@ class CapsLockWarning extends St.Label {
 
         Tweener.removeTweens(this);
 
+        const naturalHeightSet = this.natural_height_set;
         this.natural_height_set = false;
         let [, height] = this.get_preferred_height(-1);
-        this.natural_height_set = true;
+        this.natural_height_set = naturalHeightSet;
 
         Tweener.addTween(this, {
             height: capsLockOn ? height : 0,


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