mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Fix window peek issue on 3.36.1
This commit is contained in:
9
utils.js
9
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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user