[gnome-shell] overviewControls: Return zero preferred size



commit ae23ad372dde963b6101fd4fa547ba1c15a7fd97
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Mar 11 15:26:14 2021 +0100

    overviewControls: Return zero preferred size
    
    The OverviewControls actor gets allocated a fixed size by its parent,
    the OverviewActor, anyway, so it's pretty useless to go through the size
    request machinery and add up all the sizes of items in the iconGrid,
    coming up with a preferred size that's wrong anyway.
    
    Instead simply return a min and preferred size of 0 in
    get_preferred_height/width of ControlsManagerLayout.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1755>

 js/ui/overviewControls.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 2a0dd3c66d..b848811370 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -115,6 +115,16 @@ class ControlsManagerLayout extends Clutter.BoxLayout {
         this.hookup_style(container);
     }
 
+    vfunc_get_preferred_width(_container, _forHeight) {
+        // The MonitorConstraint will allocate us a fixed size anyway
+        return [0, 0];
+    }
+
+    vfunc_get_preferred_height(_container, _forWidth) {
+        // The MonitorConstraint will allocate us a fixed size anyway
+        return [0, 0];
+    }
+
     vfunc_allocate(container, box) {
         const childBox = new Clutter.ActorBox();
 


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