More intuitive maximization handling.
commitaee0ad45f27d7af9b270692aa35d8ad734c8213e
authorIain Patterson <wm@iain.cx>
Fri, 4 May 2012 16:30:01 +0000 (4 17:30 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 4 May 2012 21:39:21 +0000 (4 18:39 -0300)
treecd9def7591afea9c3e7c35eda592eb0ad9bdb105
parente6e3e1aa49f9c069372cd6bc4e792f9570448959
More intuitive maximization handling.

Avoid some pitfalls with window maximization and make it behave more
intuitively.  We now treat a window's vertical and horizontal
maximization as separate properties and only remember its original
geometry in a particular direction when it actually changes.  We also
deliberately do not remember a window's geometry when it changes from
one maximized state to another.  As a result windows can be more
reliably restored to their original size.

For example the "Maximize active window" hotkey followed by the
"Maximize active window vertically" hotkey will now result in the window
being maximized horizontally only, whereas previously the second hotkey
would have no effect because the window was already maximized
vertically.  In addition selecting the Unmaximize window menu in the
same example will now result in the window being restored to its
original size.  Previously the unmaximize attempt would have no effect
because the vertical maximization would have remembered the window's
"original" geometry when it was fully maximized.

Maximus is handled separately.  The "Maximus" hotkey will now toggle
Maximus mode regardless of the window's current maximization state.  For
example if two unmaximized windows are on screen and one is Maximusized
it will fill the space left by the second window, as before.  But if the
first window is maximized and the "Maximus" hotkey is pressed the window
will now fill the same space as if it were Maximusized from its original
size.  Previously the window would not change size from its fully
maximized state because the Maximus algorithm would consider
fully-maximized to be a valid Maximus size.
src/actions.c
src/actions.h
src/event.c
src/window.h