wayland: Send keyboard modifiers after the enter event

Change the order of events to adhere to the Wayland specification for
wl_keyboard.enter, which mandates:

> The compositor must send the wl_keyboard.modifiers event after
> this event.

Mutter currently sends the modifiers event before the enter event,
which may break applications that require information about the focused
surface in order to properly handle the modifiers.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2231
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3341>
This commit is contained in:
Alexandros Frantzis 2023-10-24 10:36:43 +03:00
parent b78951ad09
commit 3a5ecca348

View File

@ -742,10 +742,10 @@ static void
broadcast_focus (MetaWaylandKeyboard *keyboard,
struct wl_resource *resource)
{
keyboard_send_modifiers (keyboard, resource, keyboard->focus_serial);
wl_keyboard_send_enter (resource, keyboard->focus_serial,
keyboard->focus_surface->resource,
&keyboard->pressed_keys);
keyboard_send_modifiers (keyboard, resource, keyboard->focus_serial);
}
void