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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1845>
This commit is contained in:
Georges Basile Stavracas Neto 2021-05-12 11:55:34 -03:00 committed by Marge Bot
parent a63c44ba2c
commit 81210f5846

View File

@ -777,6 +777,7 @@ class SecondaryMonitorDisplay extends St.Widget {
return; return;
this._thumbnails.show(); this._thumbnails.show();
this._updateThumbnailParams();
this._thumbnails.ease_property('expand-fraction', visible ? 1 : 0, { this._thumbnails.ease_property('expand-fraction', visible ? 1 : 0, {
duration: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME, duration: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD, mode: Clutter.AnimationMode.EASE_OUT_QUAD,
@ -785,6 +786,9 @@ class SecondaryMonitorDisplay extends St.Widget {
} }
_updateThumbnailParams() { _updateThumbnailParams() {
if (!this._thumbnails.visible)
return;
const { initialState, finalState, progress } = const { initialState, finalState, progress } =
this._overviewAdjustment.getStateTransitionParams(); this._overviewAdjustment.getStateTransitionParams();