Goal: Migrating (an unmaintained) pre-45 gnome shell extension to 45.
I believe I’ve fixed the imports:
//const { GLib, GObject, Meta } = imports.gi;
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Meta from 'gi://Meta';
//const CloseDialog = imports.ui.closeDialog;
import CloseDialog from "resource:///org/gnome/shell/ui/closeDialog.js";
But, how do I migrate the rest (without minimum of theory), please?
let DisableCloseDialog = GObject.registerClass({
Implements: [ Meta.CloseDialog ],
Properties: {
window: GObject.ParamSpec.override('window', Meta.CloseDialog)
}
}, class DisableCloseDialog extends GObject.Object {
_init(window) {
super._init();
this._window = window;
}
get window() {
return this._window;
}
vfunc_show() {
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
this.response(Meta.CloseDialogResponse.WAIT);
return GLib.SOURCE_REMOVE;
});
}
vfunc_hide() {
}
vfunc_focus() {
}
});
class Extension {
constructor() {
this._origCloseDialog = CloseDialog.CloseDialog;
}
enable() {
CloseDialog.CloseDialog = DisableCloseDialog;
}
disable() {
CloseDialog.CloseDialog = this._origCloseDialog;
}
}
function init() {
return new Extension();
}
// Neither of the following works:
//
// export DisableCloseDialog;
// export default DisableCloseDialog;
// export default class DisableCloseDialog;
(GitHub - peter-lyons-kehl/gnome-disable-force-quit-popup: Disable '"XYZ" is not responding.' popup in GNOME. I’m on GNOME 45 on current Manjaro x64 Linux. If there’s a better “category”, please suggest so.)
Thank you in advance.