]> git.mdlowis.com Git - proto/labwc.git/commit
osd: make window switcher more Openbox-like in terms of key precessing
authortokyo4j <hrak1529@gmail.com>
Tue, 31 Dec 2024 01:17:05 +0000 (10:17 +0900)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Fri, 3 Jan 2025 01:51:26 +0000 (10:51 +0900)
commit713b1d8a1368366dc80df82752697ebfabd0822e
treebd30b3522685fb98b58059ad9067cf40549b32ec
parent1043cbcca9737ea3cca5fddb4d73450b7ef35e32
osd: make window switcher more Openbox-like in terms of key precessing

Before this commit, keystrokes were interpreted based on following
hard-coded rules while the window switcher is active:

  1. Up/Left arrow keys cycle the window forward.
  2. Down/Right arrow keys cycle the window backward.
  3. Other keystrokes cycle the window in the initial direction specified
     by NextWindow/PreviousWindow actions. But while Shift key is pressed,
     the direction is inverted.

...and keybind actions were never executed.

However, this lead to a counter-intuitive behavior for new, especially
pre-Openbox users. For example, in the following keybinds, after the user
activates the window switcher with Super+n, Super+p cycles the window
_forward_:

  <keybind key="W-n">
    <action name="NextWindow" />
  </keybind>
  <keybind key="W-p">
    <action name="PreviousWindow" />
  </keybind>

This is because the key 'n' is recognized just as a normal key in the
third hard-coded rule.

So this commit changes the rules to be more Openbox-like:

  1. Up/Left arrow keys cycles the window forward.
  2. Down/Right arrow keys cycles the window backward.
  3. Other keystrokes are matched against keybinds and execute their
     actions. If they include NextWindow/PreviousWindow action, it cycles
     the selected window forward/backward even while the window switcher
     is active.
docs/labwc-actions.5.scd
include/labwc.h
src/action.c
src/input/keyboard.c
src/osd.c