Skip to content

Prevent including global shortcut keys in wl_keyboard.enter

Vlad Zahorodnii requested to merge work/zzag/keyboard-enter-pressed-keys into master

78bc2688 moved pressed key tracking to a higher abstraction layer. It made pressed keys tracking less error prone but it also uncovered that the old code used not to update pressed keys in certain situations, e.g. when pressing a shortcut, but it's possible that there are more cases.

With global shortcuts, the following can occur

  • press Meta
  • press Space
  • focused keyboard surface changes, it has "Space" in the enter event
  • release Space, it will be sent to the new focused surface
  • release Meta

Depending on the implementation details, the client can register the Space key getting pressed and released.

Another event sequence that can cause unexpected behavior is

  • press q
  • the client sees it and closes its surface
  • focused keyboard surface changes, it has "q" in the enter event
  • release q

The root cause is the lack of key stroke ownership. It's not expressed in any possible way. We need to do it in long term, as a more short term solution, this change adds filtered keys property. If a particular event filter thinks that the clients should not see particular key, they just add that key to that list. After the key is released, it will be removed from the list.

BUG: 497245

depends on kwayland!122 (merged)

Merge request reports

Loading