From 3367b57c05aebc71f0be05e59a4aab8b62fb1df5 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 8 Apr 2023 09:17:06 +0200 Subject: [PATCH] :beetle: Fix incompatibility with the magic-lamp extension --- docs/changelog.md | 5 +++-- extension.js | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index ee39533..c44249c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -7,11 +7,12 @@ SPDX-License-Identifier: CC-BY-4.0 ## [Burn My Windows 29](https://github.com/schneegans/Burn-My-Windows/releases/tag/v29) -**Release Date:** TBD +**Release Date:** 2023-04-08 #### Bug Fixes -* Beetle fixed a regression introduced with the severe refactoring in the previous version: The window-close animations of Burn-My-Windows were not shown in front of full-screen windows. +* Fixed a regression which caused window-close animations not to shown in front of full-screen windows. +* Fixed an incompatibility with the [Compiz alike magic lamp effect](https://extensions.gnome.org/extension/3740/compiz-alike-magic-lamp-effect/). ## [Burn My Windows 28](https://github.com/schneegans/Burn-My-Windows/releases/tag/v28) diff --git a/extension.js b/extension.js index 0612ec6..a06b6b1 100644 --- a/extension.js +++ b/extension.js @@ -136,8 +136,8 @@ class Extension { } // We will monkey-patch these methods. Let's store the original ones. - this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor; - this._origWaitForOverviewToHide = WindowManager.prototype._waitForOverviewToHide; + this._origShouldAnimateActor = Main.wm._shouldAnimateActor; + this._origWaitForOverviewToHide = Main.wm._waitForOverviewToHide; this._origAddWindowClone = Workspace.prototype._addWindowClone; this._origWindowRemoved = Workspace.prototype._windowRemoved; this._origDoRemoveWindow = Workspace.prototype._doRemoveWindow; @@ -165,7 +165,7 @@ class Extension { // was called by either _mapWindow or _destroyWindow. If so, we return true. Let's see // if this breaks stuff left and right... // https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/main/js/ui/windowManager.js#L1120 - WindowManager.prototype._shouldAnimateActor = function(actor, types) { + Main.wm._shouldAnimateActor = function(actor, types) { const caller = (new Error()).stack.split('\n')[1]; const forClosing = caller.includes('_destroyWindow@'); const forOpening = caller.includes('_mapWindow@'); @@ -259,7 +259,7 @@ class Extension { // Usually, windows are faded in after the overview is completely hidden. We enable // window-open animations by not waiting for this. - WindowManager.prototype._waitForOverviewToHide = async function() { + Main.wm._waitForOverviewToHide = async function() { return Promise.resolve(); }; @@ -348,11 +348,11 @@ class Extension { global.window_manager.disconnect(this._killEffectsSignal); // Restore the original window-open and window-close animations. - Workspace.prototype._addWindowClone = this._origAddWindowClone; - Workspace.prototype._windowRemoved = this._origWindowRemoved; - Workspace.prototype._doRemoveWindow = this._origDoRemoveWindow; - WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor; - WindowManager.prototype._waitForOverviewToHide = this._origWaitForOverviewToHide; + Workspace.prototype._addWindowClone = this._origAddWindowClone; + Workspace.prototype._windowRemoved = this._origWindowRemoved; + Workspace.prototype._doRemoveWindow = this._origDoRemoveWindow; + Main.wm._shouldAnimateActor = this._origShouldAnimateActor; + Main.wm._waitForOverviewToHide = this._origWaitForOverviewToHide; if (WindowPreview) { WindowPreview.prototype._deleteAll = this._origDeleteAll;