Commit bfd7137f authored by Thomas Wood's avatar Thomas Wood

wayland: skip pointer and keyboard events without a surface

Pointer and keyboard events can be received after the surface has been
destroyed, in which case the surface will be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=693338
parent 8568d66a
......@@ -550,6 +550,9 @@ pointer_handle_enter (void *data,
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
device->pointer_focus = wl_surface_get_user_data(surface);
......@@ -589,6 +592,9 @@ pointer_handle_leave (void *data,
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
event = gdk_event_new (GDK_LEAVE_NOTIFY);
......@@ -777,6 +783,9 @@ keyboard_handle_enter (void *data,
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
device->keyboard_focus = wl_surface_get_user_data(surface);
......@@ -808,6 +817,9 @@ keyboard_handle_leave (void *data,
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
_gdk_wayland_display_update_serial (wayland_display, serial);
_gdk_wayland_window_remove_focus (device->keyboard_focus);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment