clutter: Add ClutterModifierSet argument to key event constructor

This struct contains the pressed/latched/locked set of modifiers applying
to the event, and may be filled in by backends generating those events.
Other places where we forward modified key events, state may be normally
obtained from the original event.

Since this constructor is used in a variety of places, this commit
updates them all in one go.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3369>
This commit is contained in:
Carlos Garnacho
2023-11-06 11:42:12 +01:00
committed by Marge Bot
parent 2e897fccd5
commit 38228da550
8 changed files with 45 additions and 0 deletions

View File

@ -360,8 +360,14 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
{
if (!filtered)
{
ClutterModifierSet raw_modifiers;
ClutterEvent *copy;
clutter_event_get_key_state (event,
&raw_modifiers.pressed,
&raw_modifiers.latched,
&raw_modifiers.locked);
/* XXX: we rely on the IM implementation to notify back of
* key events in the exact same order they were given.
*/
@ -370,6 +376,7 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
CLUTTER_EVENT_FLAG_INPUT_METHOD,
clutter_event_get_time_us (event),
clutter_event_get_device (event),
raw_modifiers,
clutter_event_get_state (event),
clutter_event_get_key_symbol (event),
clutter_event_get_event_code (event),
@ -490,6 +497,7 @@ clutter_input_method_forward_key (ClutterInputMethod *im,
CLUTTER_EVENT_FLAG_INPUT_METHOD,
time_,
keyboard,
(ClutterModifierSet) { 0, },
state,
keyval,
keycode - 8,