ssokolow / quicktile

Adds window-tiling hotkeys to any X11 desktop. (An analogue to WinSplit Revolution for people who don't want to use Compiz Grid)

Home Page:https://ssokolow.com/quicktile/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Restore the previous window's size & position before tiling.

dwsong07 opened this issue · comments

Just like the maximized windows'size and position is restored after unmaximized.

  1. Restoring the size and position after unmaximizing is handled by your window manager, not QuickTile, so it's not something I can just trivially copy-paste from one feature to another.
  2. I'm not sure what you're asking for. An "un-tile" shortcut that restores the window to the shape it was before it was first tiled?

...because I can see that being useful (If for no other reason, as an "Oops. Undo.") but it's hard to implement because, currently, QuickTile has no way to tell if it was you or the window manager that resized a window from the requested tiling shape, so it just assumes it got what it wanted. (ie. QuickTile is hiding the fact that, once you tile a window, it's never "un-tiled" again in QuickTile's eyes, so you'd be undoing back to the shape before the very first time you tiled that window.)

Thank you for your answer.

An "un-tile" shortcut that restores the window to the shape it was before it was first tiled?

Yes, you're right.

In my opinion, it can be possible to implement by remebering the position and size of the window before tiling the window.

Sorry for my bad english.

It's not hard to remember the window shape before it was first tiled. The problem is that QuickTile can't tell the difference between "MPlayer asked for a specific aspect ratio, so the window manager altered the final shape" and "You manually resized the window later".

If you start a window at 500x300+80+80, then tile it to 640x512+0+0, then resize and move it to 400x400+200+200, then tile it again, an un-tile function would change it back to 500x300+80+80 because it doesn't consider resizing something outside of QuickTile functions to be implicitly un-tiling it.

Thank you so much for answering this fast!

In my opinion, it can be implemented like this:
First the window is tiled by shortcut, change to "tiled mode".
If it is resized or moved not by quicktile, change to "non-tiled mode" and throw away the remembered position and size.

Unfortunately, it doesn't work that way. QuickTile used to do that and it broke things like MPlayer (which asks for a specific window shape) and things like terminals and Vim (which ask for windows to be locked to a multiple of the character cell size).

QuickTile doesn't move anything. It asks the window manager to make changes and then can't tell whether it was the window manager or you that changed it to something QuickTile didn't ask for.

Thank you for explaning the reason it is hard to be implemented.
I guess I'd close this issue.

Don't close it yet. I may still implement something like it, so I want to have this open as a TODO.

(When I likened it to an Undo, that's because I've actually needed an Undo myself sometimes... like when I accidentally tile an Open/Save dialog and then have to guess at the size it was before because GTK will remember.)