From 81210f584607f551de4e4d991e987fc57d309edb Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 12 May 2021 11:55:34 -0300 Subject: [PATCH] workspacesView: Don't update secondary monitor thumbnails box if hidden And save quite a few C/JS trampolines. Since the thumbnails box may not have up-to-date properties, call _updateThumbnailParams() right after showing the thumbnails box. Part-of: --- js/ui/workspacesView.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index c2d023cc4..6aa8b2615 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -777,6 +777,7 @@ class SecondaryMonitorDisplay extends St.Widget { return; this._thumbnails.show(); + this._updateThumbnailParams(); this._thumbnails.ease_property('expand-fraction', visible ? 1 : 0, { duration: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME, mode: Clutter.AnimationMode.EASE_OUT_QUAD, @@ -785,6 +786,9 @@ class SecondaryMonitorDisplay extends St.Widget { } _updateThumbnailParams() { + if (!this._thumbnails.visible) + return; + const { initialState, finalState, progress } = this._overviewAdjustment.getStateTransitionParams();