wmaker: add directional window focus

This patch is adding directional window focus
(like in openbox), where the focus can be passed to
the current window neighboors with a shortcut key.
Comparisons are performed using window centres.

New options are FocusWindowLeftKey, FocusWindowRightKey,
FocusWindowUpKey, FocusWindowDownKey.
Other WM are setting those to SUPER+LEFT/RIGHT/UP/DOWN keys
but currently those are not set by default.

CirculateRaise option which is described in WPrefs as
'Raise window when switching focus with keyboard' is also
used to raise/not raise windows that are fully covered by
other windows.
This commit is contained in:
David Maciejak
2026-04-03 10:35:39 +01:00
committed by Carlos R. Mafra
parent a3c02a22bd
commit 33fba87ed1
8 changed files with 159 additions and 0 deletions
+16
View File
@@ -1732,6 +1732,22 @@ static void dispatchWKBDCommand(int command, WScreen *scr, WWindow *wwin, XEvent
StartWindozeCycle(wwin, event, False, False);
break;
case WKBD_FOCUSLEFT:
wSetFocusToDirection(scr, DIRECTION_LEFT);
break;
case WKBD_FOCUSRIGHT:
wSetFocusToDirection(scr, DIRECTION_RIGHT);
break;
case WKBD_FOCUSUP:
wSetFocusToDirection(scr, DIRECTION_UP);
break;
case WKBD_FOCUSDOWN:
wSetFocusToDirection(scr, DIRECTION_DOWN);
break;
case WKBD_GROUPNEXT:
StartWindozeCycle(wwin, event, True, True);
break;