Add central position feature for active window
commitab45c6c6c2c624f0488d566c9108326ecf8d2843
authorDavid Maciejak <david.maciejak@gmail.com>
Thu, 30 Mar 2023 23:18:40 +0000 (31 07:18 +0800)
committerCarlos R. Mafra <crmafra@gmail.com>
Fri, 31 Mar 2023 08:11:38 +0000 (31 09:11 +0100)
tree9ed4a572fe69499a380053be3bc8573470f493ca
parent3344f2b040a69f0ca3b975eb095248a3f6e39155
Add central position feature for active window

This patch adds a new Central feature under the window menu
"Other maximization" entry.
Shortcut can be configured via WPrefs "Center active window" action.
When called the active window is centered on the screen head.
If the window height or width are bigger than the head size,
the window is resized to fit.
There are some transitions defined as below:
*from fullscreen to center
*from any corner to center
*from top half to center top half
*from bottom half to center bottom half
*from left half to center left half
*from right half to center right half

Undoing the action is done via the window menu "Unmaximize" entry
or the shortcut.
15 files changed:
WPrefs.app/KeyboardShortcuts.c
src/actions.c
src/actions.h
src/client.c
src/def_pixmaps.h
src/defaults.c
src/event.c
src/keybind.h
src/menu.c
src/menu.h
src/moveres.c
src/screen.c
src/screen.h
src/window.h
src/winmenu.c