From da738988cd9a7396baeb553e90f7355ac8137ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 26 Jun 2020 00:25:22 +0200 Subject: [PATCH] workspacesView: Small cleanup scrollToActive() and friends are only used for handling the 'switch-workspace' animation. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1333 --- js/ui/workspacesView.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 0728d2151..a6098cac4 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -508,25 +508,11 @@ class WorkspacesDisplay extends St.Widget { workspaceManager.get_active_workspace_index(); } - _activeWorkspaceChanged(_wm, _from, _to, _direction) { + _activeWorkspaceChanged(_wm, _from, to, _direction) { if (this._gestureActive) return; - this._scrollToActive(); - } - - _scrollToActive() { - let workspaceManager = global.workspace_manager; - let active = workspaceManager.get_active_workspace_index(); - - this._updateScrollAdjustment(active); - } - - _updateScrollAdjustment(index) { - if (this._gestureActive) - return; - - this._scrollAdjustment.ease(index, { + this._scrollAdjustment.ease(to, { mode: Clutter.AnimationMode.EASE_OUT_CUBIC, duration: WORKSPACE_SWITCH_TIME, });