labwc/include
John Lindgren 7571c4bed3 keyboard: avoid stuck keys due to keybindings (alternate approach)
Before commit e77330bc3f, there were issues with keys becoming "stuck"
if other keys were pressed at the time a keybinding was matched, because
those other keys were included in the "bound" set and the release events
were incorrectly eaten by labwc.

Commit e77330bc3f solved that issue with the "big hammer" approach of
preventing keybindings from working at all if other keys were pressed:

        if (key_state_nr_pressed_keys() > 1) {
                return false;
        }

This is an alternate approach to solving the original problem, by (1)
not including those other keys in the "bound" set and (2) making sure we
always forward release events for un-bound keys to clients (even if a
menu or OSD is displayed).

Details:

- Since we only ever want to store the single matched keycode as bound,
  key_state_store_pressed_keys_as_bound() doesn't really make sense in
  the plural, so rename it to key_state_store_pressed_key_as_bound() and
  pass in the keycode.

- The calls to key_state_store_pressed_keys_as_bound() within
  handle_keybinding() appear to be redundant since it is also called
  from the parent function (handle_compositor_keybindings()). So remove
  these calls.

- Finally, rework the logic for handling key-release events so that we
  always forward release events for keys not in the "bound" set.

This PR does not remove the "key_state_nr_pressed_keys() > 1" check, and
because of that should not result in any functional change. It should
however make it possible to relax or remove that check in future.
2023-11-12 17:37:30 +00:00
..
button button-png.c: s/png_load/button_png_load/ 2023-09-17 19:26:41 +01:00
common common: move MIN and MAX to common/macros.h 2023-10-21 12:37:42 +01:00
config keyboard: allow applying keyboard layout per window 2023-11-04 07:58:43 +00:00
input keyboard: avoid stuck keys due to keybindings (alternate approach) 2023-11-12 17:37:30 +00:00
menu menu: use wl_list instead of array 2023-10-10 06:17:37 +01:00
action.h action: add If and ForEach actions 2023-10-01 14:17:29 +01:00
buffer.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
debug.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
decorations.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
dnd.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
idle.h Add support for ext_idle_notify_v1.. 2023-07-09 08:26:33 +01:00
labwc.h keyboard: allow applying keyboard layout per window 2023-11-04 07:58:43 +00:00
layers.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
meson.build Make xwayland support optional 2020-12-30 10:29:21 +00:00
node.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
regions.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
resistance.h includes: identifier consistency in include guards 2023-05-13 22:29:21 +01:00
resize_indicator.h Add window resize indicator 2023-08-19 18:37:16 +02:00
session-lock.h session-lock: reconfigure for output layout changes 2023-10-05 20:10:37 +01:00
snap.h Add snap to window edge framework 2023-10-19 19:09:42 +01:00
ssd-internal.h common: rename array-size.h to macros.h 2023-10-21 12:37:42 +01:00
ssd.h src/ssd: use view->ssd_titlebar_hidden for ssd_thickness calculations 2023-09-21 22:21:19 +01:00
theme.h Refactor title height to use 'titlebar.height' from themerc 2023-10-06 22:19:16 +01:00
view-impl-common.h view: commonize sub-view logic in view_move_to_front/back() 2023-10-21 15:40:56 +01:00
view.h interactive: Make window snapping with mouse more intuitive 2023-11-10 19:41:36 +00:00
window-rules.h window-rules: add fixedPosition property 2023-11-10 21:46:15 +01:00
workspaces.h desktop: switch workspaces and optionally raise in desktop_focus_view() 2023-09-28 03:38:51 +02:00
xwayland.h common: add and use CONNECT_SIGNAL macro 2023-10-21 12:37:42 +01:00