overviewControls: Use correct state when updating AppDisplay visibility

When OverviewControls goes from HIDDEN to APP_GRID, it constantly checks
if AppDisplay needs to be visible or not by checking the current overview
state is bigger than WINDOW_PICKER. Turns out in this case this check is
problematic, because when the current state trespasses WINDOW_PICKER, the
layout manager will have already positioned AppDisplay halfway to its final
position.

Use either the final or the current state, whichever is biggest, when updating
the AppDisplay visibility. It optionally allows passing the overview state
params to _updateAppDisplayVisibility() so that we avoid a few trampolines to
recaltulate the adjustment state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1805>
This commit is contained in:
Georges Basile Stavracas Neto 2021-04-10 13:27:01 -03:00
parent ce4ece2c44
commit eb96288738

View File

@ -518,9 +518,15 @@ class ControlsManager extends St.Widget {
this._thumbnailsBox.ease(params);
}
_updateAppDisplayVisibility() {
_updateAppDisplayVisibility(stateTransitionParams = null) {
if (!stateTransitionParams)
stateTransitionParams = this._stateAdjustment.getStateTransitionParams();
const { currentState, finalState } = stateTransitionParams;
const state = Math.max(currentState, finalState);
this._appDisplay.visible =
this._stateAdjustment.value > ControlsState.WINDOW_PICKER &&
state > ControlsState.WINDOW_PICKER &&
!this._searchController.searchActive;
}
@ -536,7 +542,7 @@ class ControlsManager extends St.Widget {
fitModeAdjustment.value = fitMode;
this._updateThumbnailsBox();
this._updateAppDisplayVisibility();
this._updateAppDisplayVisibility(params);
}
_onSearchChanged() {