From 57d9e7d5aaf682b55a0945ea696cca72b50a6e72 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sun, 25 Nov 2012 23:54:11 -0500 Subject: [PATCH] workspacesView: Clean up scroll code a bit There's no code path that results in us not animating. https://bugzilla.gnome.org/show_bug.cgi?id=689062 --- js/ui/workspacesView.js | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 3528c9ad6..a247d2e61 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -208,11 +208,11 @@ const WorkspacesView = new Lang.Class({ this._workspaces[w].positionWindows(Workspace.WindowPositionFlags.ANIMATE); }, - _scrollToActive: function(showAnimation) { + _scrollToActive: function() { let active = global.screen.get_active_workspace_index(); - this._updateWorkspaceActors(showAnimation); - this._updateScrollAdjustment(active, showAnimation); + this._updateWorkspaceActors(true); + this._updateScrollAdjustment(active); }, // Update workspace actors parameters @@ -270,26 +270,21 @@ const WorkspacesView = new Lang.Class({ } }, - _updateScrollAdjustment: function(index, showAnimation) { + _updateScrollAdjustment: function(index) { if (this._scrolling) return; this._animatingScroll = true; - if (showAnimation) { - Tweener.addTween(this.scrollAdjustment, { - value: index, - time: WORKSPACE_SWITCH_TIME, - transition: 'easeOutQuad', - onComplete: Lang.bind(this, - function() { - this._animatingScroll = false; - }) - }); - } else { - this.scrollAdjustment.value = index; - this._animatingScroll = false; - } + Tweener.addTween(this.scrollAdjustment, { + value: index, + time: WORKSPACE_SWITCH_TIME, + transition: 'easeOutQuad', + onComplete: Lang.bind(this, + function() { + this._animatingScroll = false; + }) + }); }, updateWorkspaces: function(oldNumWorkspaces, newNumWorkspaces) { @@ -316,7 +311,7 @@ const WorkspacesView = new Lang.Class({ if (this._scrolling) return; - this._scrollToActive(true); + this._scrollToActive(); }, _onDestroy: function() {