Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghost opened this issue Feb 26, 2021 · 8 comments
Open

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

ghost opened this issue Feb 26, 2021 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 26, 2021

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

@ssokolow
Copy link
Owner

  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.)

@ghost
Copy link
Author

ghost commented Feb 26, 2021

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.

@ssokolow
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Feb 26, 2021

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.

@ssokolow
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Feb 26, 2021

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

@ghost ghost closed this as completed Feb 26, 2021
@ssokolow
Copy link
Owner

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.)

@ssokolow ssokolow reopened this Feb 26, 2021
@ghost
Copy link
Author

ghost commented Feb 26, 2021

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant