[gtk+] wayland: skip pointer and keyboard events without a surface
- From: Thomas Wood <thos src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: skip pointer and keyboard events without a surface
- Date: Tue, 12 Feb 2013 15:45:43 +0000 (UTC)
commit bfd7137ffbcbd8caa531d7a47d799fefb6605a5a
Author: Thomas Wood <thomas wood intel com>
Date: Thu Feb 7 15:38:40 2013 +0000
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
gdk/wayland/gdkdevice-wayland.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index bb4ef0b..90ecb17 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]