mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
clutter/event: Set logical input device for IM events
So far, we expected all events to have input devices set on them, IM events lost theirs with commit6aa42d6dad
. This somewhat made sense, because IM events are not backed by any actual device, they are generated by us in response to eg. an OSK key press. To fullfil the assumption that all devices at least have a logical input device set, pass the seat to the clutter_event_im_new() constructor and then set the device to the logical keyboard device. The source_device we leave empty, since there is no actual physical device that this event came from. Fixes:6aa42d6dad
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3236>
This commit is contained in:
parent
e0ccbcb44d
commit
aa6888e6bd
@ -145,6 +145,7 @@ CLUTTER_EXPORT
|
||||
ClutterEvent * clutter_event_im_new (ClutterEventType type,
|
||||
ClutterEventFlags flags,
|
||||
int64_t timestamp_us,
|
||||
ClutterSeat *seat,
|
||||
const char *text,
|
||||
int32_t offset,
|
||||
int32_t anchor,
|
||||
|
@ -2383,6 +2383,7 @@ ClutterEvent *
|
||||
clutter_event_im_new (ClutterEventType type,
|
||||
ClutterEventFlags flags,
|
||||
int64_t timestamp_us,
|
||||
ClutterSeat *seat,
|
||||
const char *text,
|
||||
int32_t offset,
|
||||
int32_t anchor,
|
||||
@ -2405,6 +2406,8 @@ clutter_event_im_new (ClutterEventType type,
|
||||
event->im.len = len;
|
||||
event->im.mode = mode;
|
||||
|
||||
g_set_object (&event->im.device, clutter_seat_get_keyboard (seat));
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
|
@ -279,11 +279,15 @@ clutter_input_method_put_im_event (ClutterInputMethod *im,
|
||||
uint32_t len,
|
||||
ClutterPreeditResetMode mode)
|
||||
{
|
||||
ClutterSeat *seat;
|
||||
ClutterEvent *event;
|
||||
|
||||
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
|
||||
|
||||
event = clutter_event_im_new (event_type,
|
||||
CLUTTER_EVENT_FLAG_INPUT_METHOD,
|
||||
CLUTTER_CURRENT_TIME,
|
||||
seat,
|
||||
text,
|
||||
offset,
|
||||
anchor,
|
||||
|
Loading…
Reference in New Issue
Block a user