I have recently created an extension on gnome-shell v45. Customize Clock on Lock Screen - GNOME Shell Extensions
I am not able to catch up how to work on disable function. Since the extension is using only ‘unlock-dialog’ session mode, the extension works only on lock-screen. I did several trail and errors on disable function like below
import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import ModifiedClock from './ModifiedClock.js';
export default class CustomizeClockOnLockScreenExtension extends Extension {
enable() {
this._settings = this.getSettings();
this._dialog = Main.screenShield._dialog;
this._originalClock = this._dialog._clock;
this._dialog._stack.remove_child(this._dialog._clock);
this._dialog._clock = new ModifiedClock(this._settings);
this._dialog._clock.set_pivot_point(0.5, 0.5);
this._dialog._stack.add_child(this._dialog._clock);
}
// unlock-dialog is used in session-modes because this extension purpose is
// to tweak the clock on lock screen itself.
disable() {
// this._dialog._stack.remove_child(this._dialog._clock);
// this._dialog._clock.destroy();
// this._dialog._clock = null;
// this._dialog = null;
// Main.screenShield._dialog._stack.add_child(this._originalClock);
this._settings = null;
}
}
In my several trails with disable
function empty, I found the extension is working very well rather than removing childs adding childs nulling destroying etc. Also when I disable this extension via command line with gnome-extensions disable
seems everthing is fine.
So my question is, Can I ignore those removing childs, adding childs, nulling (except this._settings
), destroying etc and leave the extensions disable
function empty?
Thanks