[gtk+/multitouch: 41/121] gtk: Handle motion hints for ::captured-event



commit 2dd737d4e6f7e7c0a92fb12cd4e1952478cdee8a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Nov 26 20:20:03 2011 +0100

    gtk: Handle motion hints for ::captured-event
    
    Request automatically more motion events in behalf of
    the original widget if it listens to motion hints. So
    the capturing widget doesn't need to handle such
    implementation details.

 gtk/gtkwidget.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 9164621..5f2755f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6053,6 +6053,17 @@ _gtk_widget_captured_event (GtkWidget *widget,
                    "GTK_CAPTURED_EVENT_STORE.");
     }
 
+  /* The widget that was originally to receive the event
+   * handles motion hints, but the capturing widget might
+   * not, so ensure we get further motion events.
+   */
+  if ((flags & GTK_CAPTURED_EVENT_HANDLED) != 0 &&
+      event->type == GDK_MOTION_NOTIFY &&
+      event->motion.is_hint &&
+      (gdk_window_get_events (event->any.window) &
+       GDK_POINTER_MOTION_HINT_MASK) != 0)
+    gdk_event_request_motions (&event->motion);
+
   return_val = (flags & GTK_CAPTURED_EVENT_HANDLED) != 0 ||
     !WIDGET_REALIZED_FOR_EVENT (widget, event);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]