Updating middleclickclose to version 1.9.1 [f1e773d].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c4b6d4d646
commit
7037664800
3 changed files with 24 additions and 23 deletions
|
@ -18,6 +18,6 @@ Otherwise you may
|
|||
glib-compile-schemas $HOME/.local/share/gnome-shell/extensions/middleclickclose@paolo.tranquilli.gmail.com/schemas
|
||||
```
|
||||
|
||||
* reload gnome-shell (Alt-F2, r, Enter)
|
||||
* activate it through Gnome Tweak Tool.
|
||||
* reload gnome-shell (Alt-F2, r, Enter) -> on Wayland you need to log out and log in again, there is no in-place reload
|
||||
* activate it through the Extensions gnome application.
|
||||

|
||||
|
|
|
@ -27,24 +27,25 @@ const Workspace = imports.ui.workspace
|
|||
const WindowPreview = imports.ui.windowPreview.WindowPreview
|
||||
const Mainloop = imports.mainloop;
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
const GObject = imports.gi.GObject;
|
||||
|
||||
const Me = ExtensionUtils.getCurrentExtension();
|
||||
|
||||
var Init = class Init {
|
||||
|
||||
_connectSettings() {
|
||||
this._settingsSignals = [];
|
||||
this._settingsSignals.push(this._settings.connect('changed::'+CLOSE_BUTTON, this._setCloseButton.bind(this)));
|
||||
this._settingsSignals.push(this._settings.connect('changed::'+REARRANGE_DELAY, this._setRearrangeDelay.bind(this)));
|
||||
_connectSettings() {
|
||||
this._settingsSignals = [];
|
||||
this._settingsSignals.push(this._settings.connect('changed::'+CLOSE_BUTTON, this._setCloseButton.bind(this)));
|
||||
this._settingsSignals.push(this._settings.connect('changed::'+REARRANGE_DELAY, this._setRearrangeDelay.bind(this)));
|
||||
}
|
||||
|
||||
_disconnectSettings() {
|
||||
while(this._settingsSignals.length > 0) {
|
||||
_disconnectSettings() {
|
||||
while(this._settingsSignals.length > 0) {
|
||||
this._settings.disconnect(this._settingsSignals.pop());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_setCloseButton() {
|
||||
_setCloseButton() {
|
||||
this._closeButton = this._settings.get_enum(CLOSE_BUTTON) + 1;
|
||||
}
|
||||
|
||||
|
@ -53,8 +54,6 @@ var Init = class Init {
|
|||
}
|
||||
|
||||
enable() {
|
||||
this._oldActivate = WindowPreview.prototype._activate;
|
||||
this._oldDoRemoveWindow = Workspace.Workspace.prototype._doRemoveWindow;
|
||||
this._oldAddWindowClone = Workspace.Workspace.prototype._addWindowClone;
|
||||
this._settings = ExtensionUtils.getSettings();
|
||||
this._oldDelay = Workspace.WINDOW_REPOSITIONING_DELAY;
|
||||
|
@ -69,20 +68,27 @@ var Init = class Init {
|
|||
if (action.get_button() == init._closeButton) {
|
||||
this._deleteAll();
|
||||
} else {
|
||||
init._oldActivate.apply(this);
|
||||
WindowPreview.prototype._activate.apply(this);
|
||||
}
|
||||
};
|
||||
|
||||
// override _addWindowClone to add my event handler
|
||||
Workspace.Workspace.prototype._addWindowClone = function(metaWindow) {
|
||||
let clone = init._oldAddWindowClone.apply(this, [metaWindow]);
|
||||
|
||||
// remove default 'clicked' signal handler
|
||||
let id = GObject.signal_handler_find(
|
||||
clone.get_actions()[0],
|
||||
{signalId: 'clicked'}
|
||||
)
|
||||
clone.get_actions()[0].disconnect(id);
|
||||
|
||||
// add custom 'clicked' signal handler
|
||||
clone.get_actions()[0].connect('clicked', onClicked.bind(clone));
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
// override WindowClone's _activate
|
||||
WindowPreview.prototype._activate = () => {};
|
||||
|
||||
// override Workspace's _doRemoveWindow in order to put into it the
|
||||
// parameteriseable rearrangement delay. Rather than copy the code from
|
||||
// workspace.js, we reuse it but remove the scheduled rearrangement task
|
||||
|
@ -93,8 +99,6 @@ var Init = class Init {
|
|||
}
|
||||
|
||||
disable() {
|
||||
WindowPreview.prototype._activate = this._oldActivate;
|
||||
Workspace.Workspace.prototype._doRemoveWindow = this._oldDoRemoveWindow;
|
||||
Workspace.WINDOW_REPOSITIONING_DELAY = this._oldDelay;
|
||||
Workspace.Workspace.prototype._addWindowClone = this._oldAddWindowClone;
|
||||
this._disconnectSettings();
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
{
|
||||
"shell-version": [
|
||||
"42",
|
||||
"43"
|
||||
],
|
||||
"shell-version": ["42","43","44"],
|
||||
"settings-schema": "org.gnome.shell.extensions.middleclickclose",
|
||||
"gettext-domain": "org.gnome.shell.extensions.middleclickclose",
|
||||
"uuid": "middleclickclose@paolo.tranquilli.gmail.com",
|
||||
|
|
Loading…
Add table
Reference in a new issue