[gnome-shell] workspacesView: Add back overview transition
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspacesView: Add back overview transition
- Date: Mon, 6 Jul 2020 22:46:39 +0000 (UTC)
commit 602078cbde4e164efbb2df05c1080b885e82c894
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jun 25 19:54:54 2020 +0200
workspacesView: Add back overview transition
The transition was temporarily removed when switching to the new
workspace layout manager. Now everything is in place to reimplement
it with a combination of the layout manager's state adjustment and
the view's allocation.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1345
js/ui/workspace.js | 38 ++++++++++++++------------------------
js/ui/workspacesView.js | 15 ++++++++++++++-
2 files changed, 28 insertions(+), 25 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 0caf95d379..d2bbfc299d 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -636,7 +636,7 @@ var WorkspaceLayout = GObject.registerClass({
// example if the container height is being animated, we want to
// avoid animating the children allocations to make sure they
// don't "lag behind" the other animation).
- if (layoutChanged) {
+ if (layoutChanged && !Main.overview.animationInProgress) {
const transition = animateAllocation(child, childBox);
if (transition) {
windowInfo.currentTransition = transition;
@@ -1149,6 +1149,15 @@ class Workspace extends St.Widget {
}
zoomToOverview() {
+ const animate =
+ this.metaWorkspace === null || this.metaWorkspace.active;
+
+ const adj = this.layout_manager.stateAdjustment;
+ adj.value = 0;
+ adj.ease(1, {
+ duration: animate ? Overview.ANIMATION_TIME : 0,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
}
zoomFromOverview() {
@@ -1166,29 +1175,10 @@ class Workspace extends St.Widget {
if (this.metaWorkspace !== null && !this.metaWorkspace.active)
return;
- // Position and scale the windows.
- for (let i = 0; i < this._windows.length; i++)
- this._zoomWindowFromOverview(i);
- }
-
- _zoomWindowFromOverview(index) {
- let clone = this._windows[index];
- clone.hideOverlay(false);
-
- if (clone.metaWindow.showing_on_its_workspace()) {
- clone.ease({
- opacity: 255,
- duration: Overview.ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- });
- } else {
- // The window is hidden, make it shrink and fade it out
- clone.ease({
- opacity: 0,
- duration: Overview.ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- });
- }
+ this.layout_manager.stateAdjustment.ease(0, {
+ duration: Overview.ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
}
_onDestroy() {
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 4c610764b3..2792efaad5 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -7,6 +7,7 @@ const Main = imports.ui.main;
const SwipeTracker = imports.ui.swipeTracker;
const Workspace = imports.ui.workspace;
+var { ANIMATION_TIME } = imports.ui.overview;
var WORKSPACE_SWITCH_TIME = 250;
var SCROLL_TIMEOUT_TIME = 150;
@@ -579,6 +580,14 @@ class WorkspacesDisplay extends St.Widget {
animateFromOverview(fadeOnPrimary) {
for (let i = 0; i < this._workspacesViews.length; i++) {
+ const { x, y, width, height } =
+ Main.layoutManager.getWorkAreaForMonitor(i);
+ this._workspacesViews[i].ease({
+ x, y, width, height,
+ duration: ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+
let animationType;
if (fadeOnPrimary && i == this._primaryIndex)
animationType = AnimationType.FADE;
@@ -707,7 +716,11 @@ class WorkspacesDisplay extends St.Widget {
if (!primaryView)
return;
- primaryView.set(this._actualGeometry);
+ primaryView.ease({
+ ...this._actualGeometry,
+ duration: Main.overview.animationInProgress ? ANIMATION_TIME : 0,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
}
_onRestacked(overview, stackIndices) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]