cycle: accept Enter to finish window switcher

Accept Enter key to finish window switcher and focus the selected window.
This follows Openbox's behavior.

This is useful when the user binds NextWindow/PreviousWindow to a key
without modifiers.
This commit is contained in:
tokyo4j 2026-05-03 03:05:20 +09:00
parent dd02daedca
commit 26d40241c0

View file

@ -472,6 +472,11 @@ handle_cycle_view_key(struct keyinfo *keyinfo)
/* Esc deactivates window switcher */ /* Esc deactivates window switcher */
cycle_finish(/*switch_focus*/ false); cycle_finish(/*switch_focus*/ false);
return true; return true;
case XKB_KEY_Return:
case XKB_KEY_KP_Enter:
/* Enter accepts the currently selected window */
cycle_finish(/*switch_focus*/ true);
return true;
case XKB_KEY_Up: case XKB_KEY_Up:
case XKB_KEY_Left: case XKB_KEY_Left:
/* Up/Left cycles the window backward */ /* Up/Left cycles the window backward */