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
|
@ -11,47 +11,69 @@
|
|||
'use strict';
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const Me = ExtensionUtils.getCurrentExtension();
|
||||
|
||||
const _Util = Me.imports.lib.util;
|
||||
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
||||
|
||||
let Me;
|
||||
let opt;
|
||||
let _firstRun = false;
|
||||
|
||||
function update(reset = false) {
|
||||
opt = Me.imports.lib.settings.opt;
|
||||
const moduleEnabled = opt.get('winAttentionHandlerModule', true);
|
||||
reset = reset || !moduleEnabled;
|
||||
var WindowAttentionHandlerModule = class {
|
||||
constructor(me) {
|
||||
Me = me;
|
||||
opt = Me.opt;
|
||||
|
||||
if (_firstRun && reset)
|
||||
return;
|
||||
|
||||
_firstRun = false;
|
||||
if (reset) {
|
||||
reset = true;
|
||||
_updateConnections(reset);
|
||||
opt = null;
|
||||
return;
|
||||
this._firstActivation = true;
|
||||
this.moduleEnabled = false;
|
||||
this._overrides = null;
|
||||
}
|
||||
|
||||
_updateConnections();
|
||||
}
|
||||
cleanGlobals() {
|
||||
Me = null;
|
||||
opt = null;
|
||||
}
|
||||
|
||||
function _updateConnections(reset) {
|
||||
global.display.disconnectObject(Main.windowAttentionHandler);
|
||||
update(reset) {
|
||||
this.moduleEnabled = opt.get('windowAttentionHandlerModule');
|
||||
const conflict = false;
|
||||
|
||||
const handlerFnc = reset
|
||||
? Main.windowAttentionHandler._onWindowDemandsAttention
|
||||
: WindowAttentionHandlerCommon._onWindowDemandsAttention;
|
||||
reset = reset || !this.moduleEnabled || conflict;
|
||||
|
||||
global.display.connectObject(
|
||||
'window-demands-attention', handlerFnc.bind(Main.windowAttentionHandler),
|
||||
'window-marked-urgent', handlerFnc.bind(Main.windowAttentionHandler),
|
||||
Main.windowAttentionHandler);
|
||||
}
|
||||
// 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(' WindowAttentionHandlerModule - Keeping untouched');
|
||||
}
|
||||
|
||||
_activateModule() {
|
||||
this._updateConnections();
|
||||
console.debug(' WindowAttentionHandlerModule - Activated');
|
||||
}
|
||||
|
||||
_disableModule() {
|
||||
const reset = true;
|
||||
this._updateConnections(reset);
|
||||
|
||||
console.debug(' WindowAttentionHandlerModule - Disabled');
|
||||
}
|
||||
|
||||
_updateConnections(reset) {
|
||||
global.display.disconnectObject(Main.windowAttentionHandler);
|
||||
|
||||
const handlerFnc = reset
|
||||
? Main.windowAttentionHandler._onWindowDemandsAttention
|
||||
: WindowAttentionHandlerCommon._onWindowDemandsAttention;
|
||||
|
||||
global.display.connectObject(
|
||||
'window-demands-attention', handlerFnc.bind(Main.windowAttentionHandler),
|
||||
'window-marked-urgent', handlerFnc.bind(Main.windowAttentionHandler),
|
||||
Main.windowAttentionHandler);
|
||||
}
|
||||
};
|
||||
|
||||
const WindowAttentionHandlerCommon = {
|
||||
_onWindowDemandsAttention(display, window) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue