Updating 44/vertical-workspaces to version 37+20231208 [0d82192].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
975b88c6bb
commit
07381ac119
37 changed files with 9559 additions and 4338 deletions
|
@ -10,51 +10,68 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
const { St, Graphene } = imports.gi;
|
||||
const Graphene = imports.gi.Graphene;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Util = imports.misc.util;
|
||||
const Workspace = imports.ui.workspace;
|
||||
const Util = imports.misc.util;
|
||||
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const Me = ExtensionUtils.getCurrentExtension();
|
||||
|
||||
const _Util = Me.imports.lib.util;
|
||||
|
||||
let _overrides;
|
||||
let Me;
|
||||
let opt;
|
||||
let _firstRun = true;
|
||||
|
||||
function update(reset = false) {
|
||||
opt = Me.imports.lib.settings.opt;
|
||||
const moduleEnabled = opt.get('workspaceModule', true);
|
||||
reset = reset || !moduleEnabled;
|
||||
var WorkspaceModule = class {
|
||||
constructor(me) {
|
||||
Me = me;
|
||||
opt = Me.opt;
|
||||
|
||||
// don't even touch this module if disabled
|
||||
if (_firstRun && reset)
|
||||
return;
|
||||
|
||||
_firstRun = false;
|
||||
|
||||
if (_overrides)
|
||||
_overrides.removeAll();
|
||||
|
||||
|
||||
if (reset) {
|
||||
Workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95;
|
||||
_overrides = null;
|
||||
opt = null;
|
||||
return;
|
||||
this._firstActivation = true;
|
||||
this.moduleEnabled = false;
|
||||
this._overrides = null;
|
||||
}
|
||||
|
||||
_overrides = new _Util.Overrides();
|
||||
cleanGlobals() {
|
||||
Me = null;
|
||||
opt = null;
|
||||
}
|
||||
|
||||
_overrides.addOverride('WorkspaceBackground', Workspace.WorkspaceBackground.prototype, WorkspaceBackground);
|
||||
update(reset) {
|
||||
this.moduleEnabled = opt.get('workspaceModule');
|
||||
const conflict = false;
|
||||
|
||||
// fix overlay base for Vertical Workspaces
|
||||
_overrides.addOverride('WorkspaceLayout', Workspace.WorkspaceLayout.prototype, WorkspaceLayout);
|
||||
}
|
||||
reset = reset || !this.moduleEnabled || conflict;
|
||||
|
||||
// don't touch the original code if module disabled
|
||||
if (reset && !this._firstActivation) {
|
||||
this._disableModule();
|
||||
} else if (!reset) {
|
||||
this._firstActivation = false;
|
||||
this._activateModule();
|
||||
}
|
||||
if (reset && this._firstActivation)
|
||||
console.debug(' WorkspaceModule - Keeping untouched');
|
||||
}
|
||||
|
||||
_activateModule() {
|
||||
if (!this._overrides)
|
||||
this._overrides = new Me.Util.Overrides();
|
||||
|
||||
this._overrides.addOverride('WorkspaceBackground', Workspace.WorkspaceBackground.prototype, WorkspaceBackground);
|
||||
|
||||
// fix overlay base for Vertical Workspaces
|
||||
this._overrides.addOverride('WorkspaceLayout', Workspace.WorkspaceLayout.prototype, WorkspaceLayout);
|
||||
console.debug(' WorkspaceModule - Activated');
|
||||
}
|
||||
|
||||
_disableModule() {
|
||||
if (this._overrides)
|
||||
this._overrides.removeAll();
|
||||
this._overrides = null;
|
||||
Workspace.WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95;
|
||||
|
||||
console.debug(' WorkspaceModule - Disabled');
|
||||
}
|
||||
};
|
||||
|
||||
// workaround for upstream bug (that is not that invisible in default shell)
|
||||
// smaller window cannot be scaled below 0.95 (WINDOW_PREVIEW_MAXIMUM_SCALE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue