diff --git a/README.md b/README.md index 6324702..3bc21b0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,11 @@ extension emit one of the following signals : * onDblClick * onRightDblClick +Other signals are available when extension is activated/deactivated : + + * onActivate + * onDeactivate + Example ------- diff --git a/dbus.xml b/dbus.xml index d189808..6cc828e 100644 --- a/dbus.xml +++ b/dbus.xml @@ -1,4 +1,5 @@ + @@ -8,6 +9,7 @@ + @@ -20,4 +22,9 @@ + + + + + diff --git a/extension.js b/extension.js index 7a14aeb..ec2464c 100644 --- a/extension.js +++ b/extension.js @@ -49,7 +49,7 @@ class MonitorWidget { // Don't know why, _rightBox seems undefined on shell 3.36 !! if (this.box === undefined) { - log(`${box} is undefined, falling back to centerBox`); + log(`${box} box is undefined, falling back to center one`); this.box = Main.panel._centerBox; } @@ -79,7 +79,6 @@ class MonitorWidget { _addToBox(lastWidget) { // lastWidget => NULL, insert at the end - // Add to box if (this.box !== Main.panel._rigthBox || lastWidget) { if (this.icon) { this.box.insert_child_above(this.icon, lastWidget); @@ -177,6 +176,7 @@ class GenericMonitorDBUS { this.clutterSettings = clutter.Settings.get_default(); this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(loadInterfaceXml('dbus.xml'), this); this._dbusImpl.export(Gio.DBus.session, '/com/soutade/GenericMonitor'); + this._dbusImpl.emit_signal('onActivate', null); } _checkParmeters(parameters) { @@ -399,6 +399,7 @@ class GenericMonitorDBUS { } destructor() { + this._dbusImpl.emit_signal('onDeactivate', null); for (let groupIndex in this.monitor_groups) { let group = this.monitor_groups[groupIndex]; for (let itemIndex in group)