diff --git a/utils.js b/utils.js index b07c6be9..6372bb0b 100644 --- a/utils.js +++ b/utils.js @@ -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); diff --git a/windowPreview.js b/windowPreview.js index f78f383c..6a96ae17 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -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(); + } }); } };