Compare commits

...

10 Commits
v8 ... v9

Author SHA1 Message Date
Simon Schneegans 458731e391 📝 Set release date
Deploy / Extension Bundle (push) Has been cancelled
2022-01-18 20:37:42 +01:00
Simon Schneegans 5c0d6afddc 🔀 Merge pull request #57 from Schneegans/feature/tryfix_54 2022-01-18 20:30:55 +01:00
Simon Schneegans 69bec85d76 📝 Update changelog 2022-01-18 20:20:35 +01:00
Simon Schneegans 3d9b0b7560 🔧 Set animation time even if we do not use it 2022-01-18 20:15:49 +01:00
Simon Schneegans e0f1e13e9c 🔀 Merge pull request #51 from Schneegans/feature/fryfix_49 2022-01-17 21:34:00 +01:00
Simon Schneegans b8db5daa12 🔧 Use try/catch for more robust import 2022-01-17 21:30:54 +01:00
Simon Schneegans c21313dd34 🔧 Do not try to fix #49 on GS 3.36 2022-01-17 21:23:03 +01:00
Simon Schneegans 0c0547f4dd 🪲 Fix crash when clicking the close buttons in the overview twice 2022-01-17 21:11:06 +01:00
Simon Schneegans 6c73574edc 🎉 Bump version number 2022-01-17 17:30:16 +01:00
Simon Schneegans afae41694c 📝 Set release date 2022-01-17 17:30:01 +01:00
3 changed files with 63 additions and 8 deletions
+10 -1
View File
@@ -1,8 +1,17 @@
# Changelog of the Burn-My-Windows Extension # Changelog of the Burn-My-Windows Extension
## [Burn My Window 9](https://github.com/schneegans/Burn-My-Windows/releases/tag/v9)
**Release Date:** 2022-01-18
#### Fixes
* Improved compatibility with [Show Application View When Workspace Empty ](https://extensions.gnome.org/extension/2036/show-application-view-when-workspace-empty/) (#54).
* Fixed a crash which happened when the window-close icon in the overview was clicked twice (#49).
## [Burn My Window 8](https://github.com/schneegans/Burn-My-Windows/releases/tag/v8) ## [Burn My Window 8](https://github.com/schneegans/Burn-My-Windows/releases/tag/v8)
**Release Date:** TBD **Release Date:** 2022-01-17
#### New Features #### New Features
+50 -4
View File
@@ -17,7 +17,14 @@ const {Clutter, Gio, Meta} = imports.gi;
const Workspace = imports.ui.workspace.Workspace; const Workspace = imports.ui.workspace.Workspace;
const WindowManager = imports.ui.windowManager.WindowManager; const WindowManager = imports.ui.windowManager.WindowManager;
const WINDOW_REPOSITIONING_DELAY = imports.ui.workspace.WINDOW_REPOSITIONING_DELAY;
// The WindowPreview class is only available on GNOME Shell 3.38+;
let WindowPreview = null;
try {
WindowPreview = imports.ui.windowPreview.WindowPreview;
} catch (error) {
// Nothing to be done, we are on GNOME Shell 3.36.
}
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension(); const Me = imports.misc.extensionUtils.getCurrentExtension();
@@ -65,10 +72,26 @@ class Extension {
this._origAddWindowClone = Workspace.prototype._addWindowClone; this._origAddWindowClone = Workspace.prototype._addWindowClone;
this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor; this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor;
// We will also override these animation times.
this._origWindowTime = imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME;
this._origDialogTime = imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME;
// We will use extensionThis to refer to the extension inside the patched methods of // We will use extensionThis to refer to the extension inside the patched methods of
// the WorkspacesView. // the WorkspacesView.
const extensionThis = this; const extensionThis = this;
// Do not attempt to close windows twice. Due to the animation in the overview, the
// close button can be clicked twice which normally would lead to a crash.
if (WindowPreview) {
this._origDeleteAll = WindowPreview.prototype._deleteAll;
WindowPreview.prototype._deleteAll = function() {
if (!this._closeRequested) {
extensionThis._origDeleteAll.apply(this);
}
};
}
// On GNOME 3.36, the window clone's 'destroy' handler only calls _removeWindowClone // On GNOME 3.36, the window clone's 'destroy' handler only calls _removeWindowClone
// but not _doRemoveWindow. The latter is required to trigger the repositioning of the // but not _doRemoveWindow. The latter is required to trigger the repositioning of the
// overview window layout. Therefore we call this method in addition. // overview window layout. Therefore we call this method in addition.
@@ -133,9 +156,11 @@ class Extension {
} }
// We do nothing if a dialog got closed and we should not burn them. // We do nothing if a dialog got closed and we should not burn them.
if (!this._settings.get_boolean('destroy-dialogs') && const isDialogWindow =
(actor.meta_window.window_type == Meta.WindowType.MODAL_DIALOG || actor.meta_window.window_type == Meta.WindowType.MODAL_DIALOG ||
actor.meta_window.window_type == Meta.WindowType.DIALOG)) { actor.meta_window.window_type == Meta.WindowType.DIALOG;
if (!this._settings.get_boolean('destroy-dialogs') && isDialogWindow) {
return; return;
} }
@@ -169,6 +194,20 @@ class Extension {
shader.set_uniform_value('uSizeY', actor.height); shader.set_uniform_value('uSizeY', actor.height);
}); });
} }
// The code below is not necessary for Burn-My-Windows to function. However, there
// are some extensions such as "Show Application View When Workspace Empty"
// https://extensions.gnome.org/extension/2036/show-application-view-when-workspace-empty/
// which do something *after* a window was closed. As the window-close animation
// duration depends on the used effect, this may vary each time a window is closed.
// We set the currently used time here, so that others can get an idea how long this
// will take...
const duration = transition.get_duration();
if (isDialogWindow) {
imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME = duration;
} else {
imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME = duration;
}
}); });
} }
@@ -187,6 +226,13 @@ class Extension {
Workspace.prototype._addWindowClone = this._origAddWindowClone; Workspace.prototype._addWindowClone = this._origAddWindowClone;
WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor; WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor;
imports.ui.windowManager.DESTROY_WINDOW_ANIMATION_TIME = this._origWindowTime;
imports.ui.windowManager.DIALOG_DESTROY_WINDOW_ANIMATION_TIME = this._origDialogTime;
if (WindowPreview) {
WindowPreview.prototype._deleteAll = this._origDeleteAll;
}
this._settings = null; this._settings = null;
} }
+1 -1
View File
@@ -11,5 +11,5 @@
"41" "41"
], ],
"url": "https://github.com/Schneegans/Burn-My-Windows", "url": "https://github.com/Schneegans/Burn-My-Windows",
"version": 8 "version": 9
} }