Add onActivate and onDeactivate signals

This commit is contained in:
2020-05-07 08:39:13 +02:00
parent acc5ef7f4f
commit 3b7247f97e
3 changed files with 15 additions and 2 deletions

View File

@@ -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)