Skip to content

Commit

Permalink
Continue using windowactor for the fade on g-s < 3.34
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesg99 committed Apr 2, 2020
1 parent 596926c commit 1e16ba2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
6 changes: 5 additions & 1 deletion panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,11 @@ var dtpPanel = Utils.defineClass({
transition: 'easeOutQuad'
};

workspace.list_windows().forEach(w => Utils.animateWindowOpacity(w.get_compositor_private(), tweenOpts));
workspace.list_windows().forEach(w => {
if (!w.minimized) {
Utils.animateWindowOpacity(w.get_compositor_private(), tweenOpts)
}
});
},

_onShowDesktopButtonPress: function() {
Expand Down
18 changes: 17 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,23 @@ var activateSiblingWindow = function(windows, direction, startWindow) {
};

var animateWindowOpacity = function(window, tweenOpts) {
Tweener.addTween(window.get_first_child(), tweenOpts);
//there currently is a mutter bug with the windowactor opacity on 3.34, so
//until it is fixed, use the windowactor's child for the fade animation
//this leaves a "shadow" on the desktop, so the windowactor needs to be hidden.
//https://gitlab.gnome.org/GNOME/mutter/issues/836
if (Config.PACKAGE_VERSION > '3.33') {
let windowActor = window;
let visible = tweenOpts.opacity > 0;

if (!windowActor.visible && visible) {
windowActor.visible = visible;
}

window = windowActor.get_first_child();
tweenOpts.onComplete = () => windowActor.visible = visible;
}

Tweener.addTween(window, tweenOpts);
};

var getIndicators = function(delegate) {
Expand Down
4 changes: 3 additions & 1 deletion windowPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ var PreviewMenu = Utils.defineClass({
wa.show();
}

Utils.animateWindowOpacity(wa, getTweenOpts({ opacity: isFocused ? 255 : dimOpacity }));
if (!mw.minimized) {
Utils.animateWindowOpacity(wa, getTweenOpts({ opacity: isFocused ? 255 : dimOpacity }));
}
}
});
},
Expand Down

0 comments on commit 1e16ba2

Please sign in to comment.