🔧 Do not try to fix #49 on GS 3.36
This commit is contained in:
+20
-14
@@ -13,17 +13,17 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const {Clutter, Gio, Meta} = imports.gi;
|
|
||||||
|
|
||||||
const Workspace = imports.ui.workspace.Workspace;
|
|
||||||
const WindowManager = imports.ui.windowManager.WindowManager;
|
|
||||||
const WindowPreview = imports.ui.windowPreview.WindowPreview;
|
|
||||||
const WINDOW_REPOSITIONING_DELAY = imports.ui.workspace.WINDOW_REPOSITIONING_DELAY;
|
|
||||||
|
|
||||||
const ExtensionUtils = imports.misc.extensionUtils;
|
const ExtensionUtils = imports.misc.extensionUtils;
|
||||||
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
const Me = imports.misc.extensionUtils.getCurrentExtension();
|
||||||
const utils = Me.imports.src.utils;
|
const utils = Me.imports.src.utils;
|
||||||
|
|
||||||
|
const {Clutter, Gio, Meta} = imports.gi;
|
||||||
|
|
||||||
|
const Workspace = imports.ui.workspace.Workspace;
|
||||||
|
const WindowManager = imports.ui.windowManager.WindowManager;
|
||||||
|
const WindowPreview =
|
||||||
|
utils.shellVersionIsAtLeast(3, 38) ? imports.ui.windowPreview.WindowPreview : null;
|
||||||
|
|
||||||
// New effects must be registered here and in prefs.js.
|
// New effects must be registered here and in prefs.js.
|
||||||
const ALL_EFFECTS = [
|
const ALL_EFFECTS = [
|
||||||
Me.imports.src.EnergizeA.EnergizeA,
|
Me.imports.src.EnergizeA.EnergizeA,
|
||||||
@@ -65,7 +65,6 @@ class Extension {
|
|||||||
this._origDoRemoveWindow = Workspace.prototype._doRemoveWindow;
|
this._origDoRemoveWindow = Workspace.prototype._doRemoveWindow;
|
||||||
this._origAddWindowClone = Workspace.prototype._addWindowClone;
|
this._origAddWindowClone = Workspace.prototype._addWindowClone;
|
||||||
this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor;
|
this._origShouldAnimateActor = WindowManager.prototype._shouldAnimateActor;
|
||||||
this._origDeleteAll = WindowPreview.prototype._deleteAll;
|
|
||||||
|
|
||||||
// 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.
|
||||||
@@ -73,11 +72,15 @@ class Extension {
|
|||||||
|
|
||||||
// Do not attempt to close windows twice. Due to the animation in the overview, the
|
// 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.
|
// close button can be clicked twice which normally would lead to a crash.
|
||||||
WindowPreview.prototype._deleteAll = function() {
|
if (WindowPreview) {
|
||||||
if (!this._closeRequested) {
|
this._origDeleteAll = WindowPreview.prototype._deleteAll;
|
||||||
extensionThis._origDeleteAll.apply(this);
|
|
||||||
}
|
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
|
||||||
@@ -196,7 +199,10 @@ class Extension {
|
|||||||
Workspace.prototype._doRemoveWindow = this._origDoRemoveWindow;
|
Workspace.prototype._doRemoveWindow = this._origDoRemoveWindow;
|
||||||
Workspace.prototype._addWindowClone = this._origAddWindowClone;
|
Workspace.prototype._addWindowClone = this._origAddWindowClone;
|
||||||
WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor;
|
WindowManager.prototype._shouldAnimateActor = this._origShouldAnimateActor;
|
||||||
WindowPreview.prototype._deleteAll = this._origDeleteAll;
|
|
||||||
|
if (WindowPreview) {
|
||||||
|
WindowPreview.prototype._deleteAll = this._origDeleteAll;
|
||||||
|
}
|
||||||
|
|
||||||
this._settings = null;
|
this._settings = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user