domferr / tilingshell

Extend Gnome Shell with advanced tiling window management. Supports multiple monitors, Windows 11 Snap Assistant, Fancy Zones, customised tiling layouts and more.
https://extensions.gnome.org/extension/7065/tiling-shell/
GNU General Public License v2.0
645 stars 20 forks source link

[Feature Request] Automatically tile newly created windows #169

Closed domferr closed 4 days ago

domferr commented 3 weeks ago

Coming soon in Tiling Shell, automatic tiling! When a window is created, it is automatically moved to the best tile according to where other windows are tiled and the current layout.

The feature is in its early stages, it follows the currently selected layout to pick the best tile for newly created windows. The setting can be enabled/disabled from the extension's preferences (disabled by default). The best tile is the vacant tile nearest to the center of the screen. Check this out!

automatic_layout

Give it a try, any feedback would be much appreciated :heart:

To know your GNOME Shell version, run gnome-shell --version.

Extract the downloaded archive. Copy its content to ~/.local/share/gnome-shell/extensions/tilingshell@ferrarodomenico.com directory. You need to reload GNOME Shell afterwards (e.g. by logging out). Then you can enable the extension:

/usr/bin/gnome-extensions enable tilingshell@ferrarodomenico.com
thyttan commented 3 weeks ago

Cool - thanks!

Some initial feedback:

If an app was previously maximized before closing it, it will launch maximized again and not be fitted into the best tile. When the windows is later unmaximized it goes into a floating state.

My initial expectation was that the window should fit into the best tile - regardless of the state it was in when it was closed before. I'm not sure what the intended behaviour should be.

Another solution may be to let it go to maximized state like it does now. But then when it is unmaximized it would be fitted to the best tile?

Demo screencast:

https://github.com/user-attachments/assets/81a4a157-7a56-4024-968c-de291fc9523a

domferr commented 2 weeks ago

Hey @thyttan thank you so much for testing this out!

This is completely intended: when a window opens maximized, I assume you are used to use it that way so I don't apply any automatic tiling. The suggestion to automatically tile when a window is unmaximized is great, thank you!

Maybe, in a later update, it could be nice to have a setting to specify whether or not automatically tile maximized windows.

domferr commented 2 weeks ago

Here it is! When windows are unmaximized they are now automatically tiled:

Edit: updated the first comment with these files.

thyttan commented 2 weeks ago

Thanks - that's very nice I think!

However, it leads me to a new edge case.

I may have a window that I want floating for the most part, but maximize at times. Then I'd want the window to return to the position it had before it was maximized.

E.g:

  1. open a window which is auto tiled.
  2. reposition it as a floating window (and maybe add the Always on top window property).
  3. maximize the window.
  4. unmaximize the window, having it return to its floating (+ potentially Always on top) state.

So the difference to the current situation would be that unmaximizing is done slightly differently depending of if (a) the window was initialized in maximized state, or if (b) it was only maximized at a later point in the windows life time.

For (a) it would always be fitted to the best tile. For (b) it would be returned to the state it had just before being maximized.

If this is not easy to accomplish I'd say it's not very important - but it would be nice and add to the polished feel 🙂

Screencast

https://github.com/user-attachments/assets/c0a07c36-4357-4665-b31b-ed16de939f04

domferr commented 2 weeks ago

Thanks - that's very nice I think!

However, it leads me to a new edge case.

I may have a window that I want floating for the most part, but maximize at times. Then I'd want the window to return to the position it had before it was maximized.

E.g:

1. open a window which is auto tiled.

2. reposition it as a floating window (and maybe add the `Always on top` window property).

3. maximize the window.

4. unmaximize the window, having it return to its floating (+ potentially `Always on top`) state.

So the difference to the current situation would be that unmaximizing is done slightly differently depending of if (a) the window was initialized in maximized state, or if (b) it was only maximized at a later point in the windows life time.

For (a) it would always be fitted to the best tile. For (b) it would be returned to the state it had just before being maximized.

If this is not easy to accomplish I'd say it's not very important - but it would be nice and add to the polished feel 🙂

Screencast

Screencast.from.2024-10-30.14-23-07.mp4

Thank you for your feedback. I understand what you mean. The doubt I have is that if the window was floating and it gets unmaximized, based on what you are doing you may desire to automatically tile as well as having that window back to the same floating position. Probably here the lack of context doesn't help.