Overview with selected apps, orphan windows in dash

Hi,

  • Is it possible to show the GS overview but only with some selected apps windows thumbnails (here 1 given app in fact)?
  • Is it possible to get an orphaned window from its button in GS dash (that does appear for some apps, e.g. a VM launched in VirtualBox, gives a “wheel” icon)? If not, what part of GS ui code does handle such apps and create this window button instead an app button in dash?

@fmuellner !
:slight_smile:

Thanks.

Is it possible to show the GS overview but only with some selected apps windows thumbnails (here 1 given app in fact)?

Yes, unless you mean: Without implementing it first.

Is it possible to get an orphaned window from its button in GS dash

You mean a window that couldn’t be matched to a .desktop file?

Sure. We create fake apps for windows that cannot be matched to a real app, so you can use Shell.App APIs like app.get_windows() like for any other app.

If you want to test for fake vs. regular apps, app.is_window_backed() returns true for the former.

1 Like

I do use this part of code to catch the app object from the GS dash elements:

this._dash_items = Main.overview.dash._dashContainer.get_first_child().get_children();
        this._dash_items.forEach(item => {
            if (item.get_first_child() && item.get_first_child()._id) {
                let app_id = item.get_first_child()._id;
                let app = this._app_system.lookup_heuristic_basename(app_id);

Is there an easier way to get the app object from the GS dash items?
I use this for this taskbar: DashBar - GNOME Shell Extensions

I tested .is_window_backed() with problematic apps (GeoGebra, my VBox VM) and others but I get always false.

Is there an easier way to get the app object from the GS dash items?

item.child.app

1 Like

Argh!
This way makes me really catching the app in all cases, that does simplify a lot this part of the code.
THANKS!

I think this extension is quite reliable now!
https://extensions.gnome.org/review/32941

Of course some time ago I tried to place the dash in panel, I mean a real GS dash object in panel.
But that makes the icons too small… :wink:

I try to reuse a lot of Shell objects but that’s a lot of work.

Hi Florian,

Is it possible to know when GS dash is redisplayed?
I don’t see any signal but maybe there’s a trick…

maybe there’s a trick…

The redisplay() function is called as deferred work, so it should be possible to hook into that:

const data = Main._deferredWorkData[dash._workId];
const {callback} = data;
data.callback = function() {
    log('redisplay!');
    callback();
};

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?

I’d consider using windowTracker.connect('notify::focus-app', ...) for tracking the app that has focus, and depending on what exactly you are trying to do, handle the focus change without rebuilding the whole thing.