ianyh / Amethyst

Automatic tiling window manager for macOS à la xmonad.
https://ianyh.com/amethyst/
MIT License
14.77k stars 489 forks source link

Windows with constant aspect ratio are not handled correctly #4

Open ianyh opened 11 years ago

ianyh commented 11 years ago

The only one I've encountered so far is the application I use for crossword puzzles, but it makes it really hard to use it with Amethyst running.

Trello Card

ianyh commented 11 years ago

To describe the problem a little bit better, Amethyst assumes that the aspect ratio is not static. Having it static results in a problem where we size a window that is very tall to have a lot of width (say 80% of the left side of the screen). Then it's taking up, say, 180% of the height, making the window not visible without manually modifying the layout ratio.

We need some way to determine when a window has a static aspect ratio (possibly testing with {0, 0, 5, 10} and {0, 0, 10, 5} and see if they result in the same aspect ratio, though that might just fail with minimum window sizes).

davibe commented 5 years ago

This happens a lot with the Android emulator, which I use often for work. It's very visible as it causes flickering when amethyst resizes the window and then the emulator resizes it back to keep its aspect ratio. It also happens with some system window like "System preferences", altought that does not flicker.

Maybe amethyst could keep measuring the window before or after resizing it. After 3 times the window has the same width/height as before and it does not apply the correct height/width (opposite dimension) it could learn that that window is a 'fixed-type' of window. Once that is known it could only resize the axis that is bigger than the desired size.

Alternatively, a fixed-size window could just float ? For my still limited experience with amythyst that would be ok as well.

Could this work ?