Thanks!
It works (but unfortunately the dash redisplay is triggered by overview and I still need the dash signal connections to update my task bar DashBar - GNOME Shell Extensions ).
My goal was to update this task bar as few as possible.
this._windows_changed = this._window_tracker.connect('tracked-windows-changed', this._update_taskbar.bind(this));
this._restacked = global.display.connect('restacked', this._update_taskbar.bind(this));
this._app_state_changed = this._app_system.connect('app-state-changed', this._update_taskbar.bind(this));
this._favorites_changed = AppFavorites.getAppFavorites().connect('changed', this._update_taskbar.bind(this));
this._installed_changed = this._app_system.connect('installed-changed', this._update_taskbar.bind(this));
Do you see any optimisation? I need here to know when dash should be updated and what app has focus, vs GS dash, that does not display this. I made a timeout as this to limit the task bar redraws:
_update_taskbar() {
if (this._update_taskbar_timeout) {
GLib.source_remove(this._update_taskbar_timeout);
this._update_taskbar_timeout = 0;
}
this._taskbar_update_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, TASKBAR_UPDATE_DELAY, () => {
this._taskbar._box.destroy_all_children();
this._add_taskbar_items();
this._taskbar_update_timeout = 0;
});
}
Again I don’t know is there is a smarter way to achieve that?