action: refresh keyboard focus when running actions with modifiers

Now that 2f8afb2 and 98bf316 are reverted, let's introduce another
approach to prevent firefox to show its menu bar with Alt-* keybinds.

In this commit, wl_keyboard.leave and wl_keyboard.enter events are sent to
the client after a action is invoked if the compositor has sent
key-release events of modifier keys. This prevents Firefox from showing
its menu bar with Alt-* keybinds, while making sure applications like
Blender see release events for modifier keys and their key state never get
stuck.
This commit is contained in:
tokyo4j 2024-12-23 02:17:39 +09:00
parent bf9a2eeb62
commit d29ee5eba3
4 changed files with 36 additions and 9 deletions

View file

@ -148,6 +148,14 @@ struct seat {
struct lab_set bound_buttons;
/*
* True when key-press events for any modifier keys has been sent to
* the client after the last wl_keyboard.enter event. This is used to
* check whether we should send wl_keyboard.{leave,enter} action
* invocations. See actions_run() for details.
*/
bool modifier_press_sent;
struct {
bool active;
struct {