[gnome-shell/wip/aday/app-grid-layout] workspace: Properly handle zero spacing in the WorkspaceLayout



commit 3b049b43b8b4bfe4b6fb0ceb822163ac95fa6a2d
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Feb 8 18:58:27 2021 +0100

    workspace: Properly handle zero spacing in the WorkspaceLayout
    
    It should be allowed to set this._spacing to 0 and thus pass 0 as
    rowSpacing or colSpacing to this._adjustSpacingAndPadding(). The current
    if-condition there won't add the oversize to the spacing in case 0 is
    passed though.
    
    So change that if-condition and explicitely check for null instead.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1698>

 js/ui/workspace.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index ba632153b3..c7021fe5ac 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -463,9 +463,9 @@ var WorkspaceLayout = GObject.registerClass({
         const [topOversize, bottomOversize] = window.chromeHeights();
         const [leftOversize, rightOversize] = window.chromeWidths();
 
-        if (rowSpacing)
+        if (rowSpacing !== null)
             rowSpacing += topOversize + bottomOversize;
-        if (colSpacing)
+        if (colSpacing !== null)
             colSpacing += Math.max(leftOversize, rightOversize);
 
         if (containerBox) {


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