fthx / dock-from-dash

GNU General Public License v3.0
96 stars 20 forks source link

Make windows minimize into the dock #14

Closed Uldreth closed 1 year ago

Uldreth commented 2 years ago

Normally windows minimize/hide into the "Activities" button, since in the default Gnome Shell, there is no dock or taskbar for windows to minimize to.

With the added "click-to-minimize" function on the dock (which is a good idea) comes the somewhat jarring effect that if the icon of an app with an open window is clicked in the dock, the window will minimize into the Activities button rather than the dock icon.

In my opinion this is jarring and counter to usual intuition. If it is not too difficult to implement (dash to dock and dash to panel have this behaviour implemented but I have no idea how complex the relevant code is), I believe this extension would be enhanced if applications minimized into their dock icons.

fthx commented 2 years ago

Yes I noticed that compared to well known docks and I I understand your request. But I won't hack that because 1) this is not the native GS behavior 2) this needs some non trivial code.

seanleavy commented 2 years ago

Hi, I know this issue is closed but I Just wanted to add that Gnome-Dev F.Meuller's 'window list' extension minimizes to the bottom panel. Maybe his solution is cleaner? The extension seems to come bundled with all Gnome distros by default and shares your minimalistic approach. Of course, the Dash To Dock & Dash To Panel could already have used that for their implantation...

Rgds Sean

fthx commented 2 years ago

I searched around and did not find anything clear. If someone can help me on this (if the solution is sound and clean and short), I'll be happy to look at this again.

nekohayo commented 1 year ago

I had a look at https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/blob/main/extensions/window-list/extension.js (I doubt it's another file in that folder), and in that file I searched for these strings:

So far we see these methods: _updatePosition, _activateWindow, _getIconGeometry, _updateIconGeometry, _minimizeOrActivateWindow ... but just by reading them, I can't really tell where the magic happens (also, I'm not really a coder). My only wild guess would be that maybe this has something to do with the icon geometry, if that name secretly hides this feature? For example, this part of the code in the WindowButton class makes me wonder if that might be "it" :

    _updateIconGeometry() {
        let rect = this._getIconGeometry();

        let windows = this.app.get_windows();
        windows.forEach(w => w.set_icon_geometry(rect));
    }

(There are of course other references to IconGeometry throughout the rest of the code, but I wanted to point out this one, its last line in particular...)

Someone better than me should have a look at this :)