1
0
Fork 0

backends/native: Use correct constructor for CLUTTER_TOUCH_CANCEL events

We were using the generic constructor for BEGIN/UPDATE/END events, that
have more data than CLUTTER_TOUCH_CANCEL. Since that function checks for
the event type, we were awkwardly forwarding a NULL event here.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/3016
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3261>
This commit is contained in:
Carlos Garnacho 2023-09-10 17:41:51 +02:00 committed by Marge Bot
parent 3f7c1be59a
commit 4075847278

View file

@ -1071,14 +1071,24 @@ meta_seat_impl_notify_touch_event_in_impl (MetaSeatImpl *seat_impl,
evtype == CLUTTER_TOUCH_UPDATE) evtype == CLUTTER_TOUCH_UPDATE)
modifiers |= CLUTTER_BUTTON1_MASK; modifiers |= CLUTTER_BUTTON1_MASK;
event = if (evtype == CLUTTER_TOUCH_CANCEL)
clutter_event_touch_new (evtype, {
CLUTTER_EVENT_NONE, event = clutter_event_touch_cancel_new (CLUTTER_EVENT_NONE,
time_us, time_us,
input_device, input_device,
sequence, sequence);
modifiers, }
GRAPHENE_POINT_INIT (x, y)); else
{
event =
clutter_event_touch_new (evtype,
CLUTTER_EVENT_NONE,
time_us,
input_device,
sequence,
modifiers,
GRAPHENE_POINT_INIT (x, y));
}
queue_event (seat_impl, event); queue_event (seat_impl, event);
} }