[gnome-shell/gnome-40] workspace: Move fading minimized windows out of allocation
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-40] workspace: Move fading minimized windows out of allocation
- Date: Tue, 21 Sep 2021 18:08:46 +0000 (UTC)
commit ac58c331805b03f1639f1b3be8a0bf834cbd3654
Author: Sebastian Keller <skeller gnome org>
Date: Thu Aug 19 20:58:31 2021 +0200
workspace: Move fading minimized windows out of allocation
eee2ccac fixed window opacity being changed outside of transitions but
resulted in the final step of the transition, that would set the window
to fully opaque, being missed.
This change now moves the opacity change entirely out of allocation and
instead follows the adjustment changes directly, which still fixes the
original bug and ensures the opacity is also applied for the last step
in the transition.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4561
(cherry picked from commit b90a6d6b14476544399b0be0dce214fc24986249)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1982>
js/ui/workspace.js | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 79d6cf146b..6c32f01da9 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -429,6 +429,7 @@ var WorkspaceLayout = GObject.registerClass({
});
this._stateAdjustment.connect('notify::value', () => {
+ this._syncOpacities();
this.syncOverlays();
this.layout_changed();
});
@@ -437,6 +438,17 @@ var WorkspaceLayout = GObject.registerClass({
this._workareasChangedId = 0;
}
+ _syncOpacity(actor, metaWindow) {
+ if (!metaWindow.showing_on_its_workspace())
+ actor.opacity = this._stateAdjustment.value * 255;
+ }
+
+ _syncOpacities() {
+ this._windows.forEach(({ metaWindow }, actor) => {
+ this._syncOpacity(actor, metaWindow);
+ });
+ }
+
_isBetterScaleAndSpace(oldScale, oldSpace, scale, space) {
let spacePower = (space - oldSpace) * LAYOUT_SPACE_WEIGHT;
let scalePower = (scale - oldScale) * LAYOUT_SCALE_WEIGHT;
@@ -627,7 +639,7 @@ var WorkspaceLayout = GObject.registerClass({
}
const { ControlsState } = OverviewControls;
- const { currentState, transitioning } =
+ const { currentState } =
this._overviewAdjustment.getStateTransitionParams();
const inSessionTransition = currentState <= ControlsState.WINDOW_PICKER;
@@ -689,9 +701,6 @@ var WorkspaceLayout = GObject.registerClass({
workspaceBoxY = workareaY * allocationScale;
workspaceBoxWidth = 0;
workspaceBoxHeight = 0;
-
- if (transitioning)
- child.opacity = stateAdjustementValue * 255;
}
// Don't allow the scaled floating size to drop below
@@ -792,6 +801,7 @@ var WorkspaceLayout = GObject.registerClass({
return winA.get_stable_sequence() - winB.get_stable_sequence();
});
+ this._syncOpacity(window, metaWindow);
this._syncOverlay(window);
this._container.add_child(window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]