summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2013-08-04 14:01:10 +0100
committerRob Bradford <rob@linux.intel.com>2013-08-04 14:42:14 +0100
commit3625f17857328ae7e7aa43340f29efa56575a7b0 (patch)
tree1ab27cf4988bb99a14fb3e7b9b1c2564943b205b /gdk
parente8e6ae81893ac4a108f5a35ef87091317311e14f (diff)
downloadgtk+-3625f17857328ae7e7aa43340f29efa56575a7b0.tar.gz
wayland: Only try and process pointer events when focussed
When combining Clutter with GTK+ we can receive events for surfaces which in the client side we do not have focussed.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkdevice-wayland.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 7624fa1b46..862942cae7 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -645,6 +645,8 @@ pointer_handle_leave (void *data,
return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
+ if (!device->pointer_focus)
+ return;
_gdk_wayland_display_update_serial (wayland_display, serial);
@@ -689,6 +691,9 @@ pointer_handle_motion (void *data,
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkEvent *event;
+ if (!device->pointer_focus)
+ return;
+
event = gdk_event_new (GDK_NOTHING);
device->time = time;
@@ -729,6 +734,9 @@ pointer_handle_button (void *data,
GdkWaylandDisplay *wayland_display =
GDK_WAYLAND_DISPLAY (device->display);
+ if (!device->pointer_focus)
+ return;
+
_gdk_wayland_display_update_serial (wayland_display, serial);
switch (button) {
@@ -784,6 +792,9 @@ pointer_handle_axis (void *data,
GdkEvent *event;
gdouble delta_x, delta_y;
+ if (!device->pointer_focus)
+ return;
+
/* get the delta and convert it into the expected range */
switch (axis) {
case WL_POINTER_AXIS_VERTICAL_SCROLL: