[gnome-shell/wip/jimmac/dash-icon-spacing: 54/72] workspacesView: Use allocation sizes to begin swipe gesture




commit c5620c36b8d00d25cf988d1bd39d3cf4a8aff430
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jan 6 14:26:27 2021 -0300

    workspacesView: Use allocation sizes to begin swipe gesture
    
    Instead of relying on the 'width' and 'height' properties, which can return
    different values depending on various circumstances, use the current allocation
    to begin the swipe gesture.
    
    This avoids a division by zero in SwipeTracker.

 js/ui/workspacesView.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index f5689f849f..f56e2cc9e0 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -674,7 +674,8 @@ class WorkspacesDisplay extends St.Widget {
             this._workspacesViews[i].startTouchGesture();
 
         let distance = global.workspace_manager.layout_rows === -1
-            ? this.height : this.width;
+            ? this.allocation.get_width()
+            : this.allocation.get_height();
 
         let progress = adjustment.value / adjustment.page_size;
         let points = Array.from(


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