[clutter/clutter-1.16] wayland: Only process enter and leave events Clutter created surfaces
- From: Rob Bradford <rbradford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.16] wayland: Only process enter and leave events Clutter created surfaces
- Date: Sun, 4 Aug 2013 14:44:34 +0000 (UTC)
commit 9808da7efed1ef96f3b0d8bdbd07c82da7fddffd
Author: Rob Bradford <rob linux intel com>
Date: Sun Aug 4 15:38:40 2013 +0100
wayland: Only process enter and leave events Clutter created surfaces
When combining with GTK we will receive enter and leave events for surfaces
from both toolkits therefore we must filter our events appropriately.
clutter/wayland/clutter-input-device-wayland.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/clutter/wayland/clutter-input-device-wayland.c b/clutter/wayland/clutter-input-device-wayland.c
index 25b611c..c547bda 100644
--- a/clutter/wayland/clutter-input-device-wayland.c
+++ b/clutter/wayland/clutter-input-device-wayland.c
@@ -356,6 +356,9 @@ clutter_wayland_handle_pointer_enter (void *data,
ClutterBackend *backend;
ClutterBackendWayland *backend_wayland;
+ if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface)))
+ return;
+
stage_cogl = wl_surface_get_user_data (surface);
device->pointer_focus = stage_cogl;
@@ -407,6 +410,9 @@ clutter_wayland_handle_pointer_leave (void *data,
ClutterStageCogl *stage_cogl;
ClutterEvent *event;
+ if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface)))
+ return;
+
stage_cogl = wl_surface_get_user_data (surface);
g_assert (device->pointer_focus == stage_cogl);
@@ -434,6 +440,9 @@ clutter_wayland_handle_keyboard_enter (void *data,
ClutterInputDeviceWayland *device = data;
ClutterStageCogl *stage_cogl;
+ if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface)))
+ return;
+
stage_cogl = wl_surface_get_user_data (surface);
g_assert (device->keyboard_focus == NULL);
device->keyboard_focus = stage_cogl;
@@ -452,6 +461,11 @@ clutter_wayland_handle_keyboard_leave (void *data,
ClutterInputDeviceWayland *device = data;
ClutterStageCogl *stage_cogl;
+ if (!surface)
+ return;
+ if (!CLUTTER_IS_STAGE_COGL (wl_surface_get_user_data (surface)))
+ return;
+
stage_cogl = wl_surface_get_user_data (surface);
g_assert (device->keyboard_focus == stage_cogl);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]