Fix window peek issue on 3.36.1

This commit is contained in:
Charles Gagnon
2020-04-29 17:36:52 -04:00
parent f1db6e3f93
commit 468b53565d
2 changed files with 12 additions and 7 deletions

View File

@@ -426,11 +426,12 @@ var activateSiblingWindow = function(windows, direction, startWindow) {
};
var animateWindowOpacity = function(window, tweenOpts) {
//there currently is a mutter bug with the windowactor opacity, starting with 3.34
//there is a mutter bug with the windowactor opacity, starting with 3.34 and ending with 3.36.1
//https://gitlab.gnome.org/GNOME/mutter/issues/836
let shellVersion = Config.PACKAGE_VERSION;
if (Config.PACKAGE_VERSION > '3.35') {
//on 3.36, a workaround is to use the windowactor's child for the fade animation
if (shellVersion > '3.35' && shellVersion < '3.36.1') {
//on <= 3.36, a workaround is to use the windowactor's child for the fade animation
//this leaves a "shadow" on the desktop, so the windowactor needs to be hidden
//when the animation is complete
let visible = tweenOpts.opacity > 0;
@@ -442,7 +443,7 @@ var animateWindowOpacity = function(window, tweenOpts) {
window = windowActor.get_first_child() || windowActor;
tweenOpts.onComplete = () => windowActor.visible = visible;
} else if (Config.PACKAGE_VERSION > '3.33') {
} else if (shellVersion > '3.33' && shellVersion < '3.35') {
//the workaround only works on 3.35+, so on 3.34, let's just hide the
//window without animation
return window.visible = (tweenOpts.opacity == 255);

View File

@@ -626,15 +626,16 @@ var PreviewMenu = Utils.defineClass({
_switchToWorkspaceImmediate: function(workspaceIndex) {
let workspace = Utils.getWorkspaceByIndex(workspaceIndex);
let shouldAnimate = Main.wm._shouldAnimate;
if (!workspace || (!workspace.list_windows().length &&
workspaceIndex < Utils.getWorkspaceCount() -1)) {
workspace = Utils.getCurrentWorkspace();
}
Main.wm._blockAnimations = true;
Main.wm._shouldAnimate = () => false;
workspace.activate(global.display.get_current_time_roundtrip());
Main.wm._blockAnimations = false;
Main.wm._shouldAnimate = shouldAnimate;
},
_focusMetaWindow: function(dimOpacity, window) {
@@ -801,7 +802,10 @@ var Preview = Utils.defineClass({
} else if (!this._waitWindowId) {
this._waitWindowId = Mainloop.idle_add(() => {
this._waitWindowId = 0;
_assignWindowClone();
if (this._previewMenu.opened) {
_assignWindowClone();
}
});
}
};