[gtk+/multitouch-for-3.4: 26/89] gtk: Handle motion hints for ::captured-event
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/multitouch-for-3.4: 26/89] gtk: Handle motion hints for ::captured-event
- Date: Thu, 23 Feb 2012 12:28:07 +0000 (UTC)
commit 220b4130ec56dacb286ab3f5b19f913cb965bce9
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 7171791..668e353 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5927,6 +5927,17 @@ _gtk_widget_captured_event (GtkWidget *widget,
g_signal_emit (widget, widget_signals[CAPTURED_EVENT], 0, event, &return_val);
return_val |= !WIDGET_REALIZED_FOR_EVENT (widget, event);
+ /* 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 (return_val &&
+ 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);
+
g_object_unref (widget);
return return_val;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]