[gtk+] On pointer grab request native events needed for event emulation
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] On pointer grab request native events needed for event emulation
- Date: Fri, 25 Sep 2009 09:58:43 +0000 (UTC)
commit 3bcf8b39fb7651cbdeaf356cbe829799cc0b1ed0
Author: Alexander Larsson <alexl redhat com>
Date: Fri Sep 25 11:28:26 2009 +0200
On pointer grab request native events needed for event emulation
When we grab the pointer we need to request more events than what is
specified, otherwise our event emulation stop working and you won't
e.g. get crossing event unless you specified motion event mask.
gdk/gdkwindow.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 3231dea..c8e7249 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1184,6 +1184,23 @@ get_native_event_mask (GdkWindowObject *private)
}
}
+static GdkEventMask
+get_native_grab_event_mask (GdkEventMask grab_mask)
+{
+ /* Similar to the above but for pointer events only */
+ return
+ GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
+ GDK_SCROLL_MASK |
+ (grab_mask &
+ ~(GDK_POINTER_MOTION_HINT_MASK |
+ GDK_BUTTON_MOTION_MASK |
+ GDK_BUTTON1_MOTION_MASK |
+ GDK_BUTTON2_MOTION_MASK |
+ GDK_BUTTON3_MOTION_MASK));
+}
+
/* Puts the native window in the right order wrt the other native windows
* in the hierarchy, given the position it has in the client side data.
* This is useful if some operation changed the stacking order.
@@ -9564,7 +9581,7 @@ gdk_pointer_grab (GdkWindow * window,
res = _gdk_windowing_pointer_grab (window,
native,
owner_events,
- event_mask,
+ get_native_grab_event_mask (event_mask),
confine_to,
cursor,
time);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]