[gtk+/gtk-2-24-quartz] Handle implicit grabs
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24-quartz] Handle implicit grabs
- Date: Wed, 23 Nov 2011 22:57:56 +0000 (UTC)
commit fb27b84746b065772e3d8e4513f93317fcfd1b99
Author: Alexander Larsson <alexl redhat com>
Date: Tue Oct 18 16:52:41 2011 +0200
Handle implicit grabs
gdk/win32/gdkevents-win32.c | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 8dec80c..b3b095a 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1855,6 +1855,12 @@ ensure_stacking_on_activate_app (MSG *msg,
}
}
+#define GDK_ANY_BUTTON_MASK (GDK_BUTTON1_MASK | \
+ GDK_BUTTON2_MASK | \
+ GDK_BUTTON3_MASK | \
+ GDK_BUTTON4_MASK | \
+ GDK_BUTTON5_MASK)
+
static gboolean
gdk_event_translate (MSG *msg,
gint *ret_valp)
@@ -2261,7 +2267,12 @@ gdk_event_translate (MSG *msg,
if (GDK_WINDOW_DESTROYED (window))
break;
- /* TODO_CSW? Emulate X11's automatic active grab */
+ grab = _gdk_display_get_last_pointer_grab (_gdk_display);
+ if (grab == NULL)
+ {
+ SetCapture (GDK_WINDOW_HWND (window));
+ }
+
generate_button_event (GDK_BUTTON_PRESS, button,
window, msg);
@@ -2301,6 +2312,16 @@ gdk_event_translate (MSG *msg,
}
#endif
+ grab = _gdk_display_get_last_pointer_grab (_gdk_display);
+ if (grab != NULL && grab->implicit)
+ {
+ gint state = build_pointer_event_state (msg);
+
+ /* We keep the implicit grab until no buttons at all are held down */
+ if ((state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (button - 1))) == 0)
+ ReleaseCapture ();
+ }
+
generate_button_event (GDK_BUTTON_RELEASE, button,
window, msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]