[gnome-shell/gbsneto/40-stuff: 53/68] workspacesView: Use allocation sizes to begin swipe gesture




commit 852b45d42805454cd2f2635a1d4a8e0f31b0233b
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 1fa858f246..4c28c4b2ff 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -670,7 +670,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]