gdk: Avoid poking possibly freed memory

The event may end up freed after delivery, ensure to keep a ref in order
to emit the matching emulated crossed event matching a proximity event.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
This commit is contained in:
Carlos Garnacho 2019-10-08 17:56:10 +02:00
parent f354a7787a
commit 075c77325b

View File

@ -3327,6 +3327,8 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
if (!event) if (!event)
return; return;
g_object_ref (event);
switch ((guint) event->any.type) switch ((guint) event->any.type)
{ {
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
@ -3367,6 +3369,8 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
emulate_crossing (event->any.surface, NULL, emulate_crossing (event->any.surface, NULL,
tablet->master, GDK_ENTER_NOTIFY, tablet->master, GDK_ENTER_NOTIFY,
GDK_CROSSING_NORMAL, time); GDK_CROSSING_NORMAL, time);
g_object_unref (event);
} }
static GdkEvent * static GdkEvent *