overviewControls: Ease main adjustment when animating to/from overview
Instead of delegating it to ViewSelector, make the transition to and from
overview ease the main state adjustment.
This commit temporarily breaks these animations, but on the other hand
introduces an important feature: ViewSelector is always allocated to the
actual size. This will finally allow for adding WorkspacesView as a child
of WorkspacesDisplay, and finally remove the actual geometry hack, which
is what next commit is about.
This commit also effectively reverts b64103efc
.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
This commit is contained in:
parent
0a8aeebd30
commit
b6337a7bf1
@ -83,6 +83,8 @@ class ControlsManager extends St.Widget {
|
|||||||
clip_to_allocation: true,
|
clip_to_allocation: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._ignoreShowAppsButtonToggle = false;
|
||||||
|
|
||||||
this._searchEntry = new St.Entry({
|
this._searchEntry = new St.Entry({
|
||||||
style_class: 'search-entry',
|
style_class: 'search-entry',
|
||||||
/* Translators: this is the text displayed
|
/* Translators: this is the text displayed
|
||||||
@ -144,6 +146,9 @@ class ControlsManager extends St.Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onShowAppsButtonToggled() {
|
_onShowAppsButtonToggled() {
|
||||||
|
if (this._ignoreShowAppsButtonToggle)
|
||||||
|
return;
|
||||||
|
|
||||||
const checked = this.dash.showAppsButton.checked;
|
const checked = this.dash.showAppsButton.checked;
|
||||||
|
|
||||||
const value = checked
|
const value = checked
|
||||||
@ -174,10 +179,27 @@ class ControlsManager extends St.Widget {
|
|||||||
|
|
||||||
animateToOverview() {
|
animateToOverview() {
|
||||||
this.viewSelector.animateToOverview();
|
this.viewSelector.animateToOverview();
|
||||||
|
|
||||||
|
this._stateAdjustment.value = ControlsState.HIDDEN;
|
||||||
|
this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
|
||||||
|
duration: Overview.ANIMATION_TIME,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
animateFromOverview() {
|
animateFromOverview() {
|
||||||
|
this._ignoreShowAppsButtonToggle = true;
|
||||||
|
|
||||||
this.viewSelector.animateFromOverview();
|
this.viewSelector.animateFromOverview();
|
||||||
|
|
||||||
|
this._stateAdjustment.ease(ControlsState.HIDDEN, {
|
||||||
|
duration: Overview.ANIMATION_TIME,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
|
onStopped: () => {
|
||||||
|
this.dash.showAppsButton.checked = false;
|
||||||
|
this._ignoreShowAppsButtonToggle = false;
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get searchEntry() {
|
get searchEntry() {
|
||||||
|
@ -411,8 +411,6 @@ var ViewSelector = GObject.registerClass({
|
|||||||
animateFromOverview() {
|
animateFromOverview() {
|
||||||
this._workspacesDisplay.animateFromOverview();
|
this._workspacesDisplay.animateFromOverview();
|
||||||
|
|
||||||
this._showAppsButton.checked = false;
|
|
||||||
|
|
||||||
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
|
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
|
||||||
Main.overview.fadeInDesktop();
|
Main.overview.fadeInDesktop();
|
||||||
}
|
}
|
||||||
|
@ -534,7 +534,6 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
this._leavingOverview = false;
|
this._leavingOverview = false;
|
||||||
|
|
||||||
this._gestureActive = false; // touch(pad) gestures
|
this._gestureActive = false; // touch(pad) gestures
|
||||||
this._animating = false;
|
|
||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
}
|
}
|
||||||
@ -705,28 +704,14 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
animateFromOverview() {
|
animateFromOverview() {
|
||||||
this._animating = true;
|
|
||||||
|
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
this._workspacesViews[i].animateFromOverview();
|
this._workspacesViews[i].animateFromOverview();
|
||||||
|
|
||||||
this._leavingOverview = true;
|
this._leavingOverview = true;
|
||||||
this._updateSwipeTracker();
|
this._updateSwipeTracker();
|
||||||
|
|
||||||
const { primaryIndex } = Main.layoutManager;
|
|
||||||
const { x, y, width, height } =
|
|
||||||
Main.layoutManager.getWorkAreaForMonitor(primaryIndex);
|
|
||||||
this._getPrimaryView().ease({
|
|
||||||
x, y, width, height,
|
|
||||||
duration: ANIMATION_TIME,
|
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
|
||||||
onStopped: () => (this._animating = false),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_hide() {
|
vfunc_hide() {
|
||||||
this._animating = false;
|
|
||||||
|
|
||||||
if (this._restackedNotifyId > 0) {
|
if (this._restackedNotifyId > 0) {
|
||||||
Main.overview.disconnect(this._restackedNotifyId);
|
Main.overview.disconnect(this._restackedNotifyId);
|
||||||
this._restackedNotifyId = 0;
|
this._restackedNotifyId = 0;
|
||||||
@ -759,8 +744,6 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateWorkspacesViews() {
|
_updateWorkspacesViews() {
|
||||||
this._animating = false;
|
|
||||||
|
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
this._workspacesViews[i].destroy();
|
this._workspacesViews[i].destroy();
|
||||||
|
|
||||||
@ -837,9 +820,6 @@ class WorkspacesDisplay extends St.Widget {
|
|||||||
|
|
||||||
this._syncActualGeometryLater =
|
this._syncActualGeometryLater =
|
||||||
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
|
||||||
if (this._animating)
|
|
||||||
return GLib.SOURCE_CONTINUE;
|
|
||||||
|
|
||||||
this._syncWorkspacesActualGeometry();
|
this._syncWorkspacesActualGeometry();
|
||||||
|
|
||||||
this._syncActualGeometryLater = 0;
|
this._syncActualGeometryLater = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user