[gnome-shell/wip/exalm/gestures: 8/11] g



commit aca3e190a98b79828376c35ece5e47f0294f8a16
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Mon Jun 24 00:13:58 2019 +0500

    g

 js/ui/windowManager.js  | 40 +++++++++++++++++++++-------------------
 js/ui/workspacesView.js |  4 ++--
 2 files changed, 23 insertions(+), 21 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index bb3066ea5..32a80bc08 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1040,24 +1040,10 @@ var WindowManager = class {
         let activeWorkspace = workspaceManager.get_active_workspace();
 
         if (this._switchData && this._switchData.gestureActivated) {
+            Tweener.removeTweens(this._switchData);
             Tweener.removeTweens(this._switchData.container);
 
-            let currWs = global.workspace_manager.get_active_workspace();
-            let topWs = activeWorkspace.get_neighbor(Meta.MotionDirection.UP);
-            let bottomWs = activeWorkspace.get_neighbor(Meta.MotionDirection.DOWN);
-            let [xDestTop, yDestTop] = this._getPositionForDirection(Meta.MotionDirection.UP, currWs, topWs);
-            let [xDestBottom, yDestBottom] = this._getPositionForDirection(Meta.MotionDirection.DOWN, 
currWs, bottomWs);
-            let [x, y] = this._switchData.container.get_position();
-
-            xDestTop = -xDestTop;
-            yDestTop = -yDestTop;
-            xDestBottom = -xDestBottom;
-            yDestBottom = -yDestBottom;
-
-            // TODO: horizontal
-            let progress = y / (y > 0 ? -yDestTop : yDestBottom);
-
-            this._swipeTracker.continueFrom(progress);
+            this._swipeTracker.continueFrom(this._switchData.progress);
             return;
         }
 
@@ -1072,6 +1058,7 @@ var WindowManager = class {
         if (!this._switchData)
             return;
 
+        this._switchData.progress = progress;
         this._switchData.container.set_position(0, Math.round(-progress * (global.screen_height - 
Main.panel.height)));
     }
 
@@ -1099,6 +1086,11 @@ var WindowManager = class {
             return;
 
         let switchData = this._switchData;
+        Tweener.addTween(switchData,
+                         { progress: 0,
+                           time: duration,
+                           transition: 'easeOutCubic'
+                         });
         Tweener.addTween(switchData.container,
                          { x: 0,
                            y: 0,
@@ -1119,6 +1111,11 @@ var WindowManager = class {
         xDest = -xDest;
         yDest = -yDest;
 
+        Tweener.addTween(switchData,
+                         { progress: direction == Meta.MotionDirection.DOWN ? 1 : -1,
+                           time: duration,
+                           transition: 'easeOutCubic'
+                         });
         Tweener.addTween(switchData.container,
                          { x: xDest,
                            y: yDest,
@@ -1897,8 +1894,7 @@ var WindowManager = class {
         switchData.surroundings = {};
         switchData.gestureActivated = false;
         switchData.inProgress = false;
-        switchData.xPos = 0;
-        switchData.yPos = 0;
+        switchData.progress = 0;
 
         switchData.container = new Clutter.Actor();
         switchData.container.add_actor(switchData.curGroup);
@@ -1994,6 +1990,7 @@ var WindowManager = class {
                 global.workspace_manager.get_active_workspace())
                 w.window.hide();
         }
+        Tweener.removeTweens(switchData);
         Tweener.removeTweens(switchData.container);
         switchData.container.destroy();
         switchData.movingWindowBin.destroy();
@@ -2027,11 +2024,16 @@ var WindowManager = class {
         xDest = -xDest;
         yDest = -yDest;
 
+        Tweener.addTween(this._switchData,
+                         { progress: direction == Meta.MotionDirection.DOWN ? 1 : -1,
+                           time: WINDOW_ANIMATION_TIME,
+                           transition: 'easeOutCubic'
+                         });
         Tweener.addTween(this._switchData.container,
                          { x: xDest,
                            y: yDest,
                            time: WINDOW_ANIMATION_TIME,
-                           transition: 'easeOutQuad',
+                           transition: 'easeOutCubic',
                            onComplete: this._switchWorkspaceDone,
                            onCompleteScope: this,
                            onCompleteParams: [shellwm]
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 78a1c8104..de2e538a4 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -472,13 +472,13 @@ var WorkspacesDisplay = class {
         Main.overview.addAction(switchGesture);
         this.actor.bind_property('mapped', switchGesture, 'enabled', GObject.BindingFlags.SYNC_CREATE);
 
-        switchGesture = new WindowManager.TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
+/*        switchGesture = new WindowManager.TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
         switchGesture.connect('motion', this._onSwitchWorkspaceMotion.bind(this));
         switchGesture.connect('activated', this._onSwitchWorkspaceActivated.bind(this));
         switchGesture.connect('cancel', this._endTouchGesture.bind(this));
         this.actor.connect('notify::mapped', () => {
             switchGesture.enabled = this.actor.mapped;
-        });
+        });*/
 
         this._primaryIndex = Main.layoutManager.primaryIndex;
 


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