From 6e9b054543213692f47740143497d87786843a75 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 7 May 2014 19:06:42 +0200 Subject: [PATCH] widget: Fix gesture event handler retval for bubbled events Do not clobber the return value if the regular event handler happens to return FALSE, even if the gesture meant to consume the event. --- gtk/gtkwidget.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 3a8205e98c..87ac87396d 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -7459,7 +7459,7 @@ static gint gtk_widget_event_internal (GtkWidget *widget, GdkEvent *event) { - gboolean return_val = FALSE; + gboolean return_val = FALSE, handled; /* We check only once for is-still-visible; if someone * hides the window in on of the signals on the widget, @@ -7472,8 +7472,8 @@ gtk_widget_event_internal (GtkWidget *widget, g_object_ref (widget); return_val |= _gtk_widget_run_controllers (widget, event, GTK_PHASE_BUBBLE); - g_signal_emit (widget, widget_signals[EVENT], 0, event, &return_val); - return_val |= !WIDGET_REALIZED_FOR_EVENT (widget, event); + g_signal_emit (widget, widget_signals[EVENT], 0, event, &handled); + return_val |= handled | !WIDGET_REALIZED_FOR_EVENT (widget, event); if (!return_val) { gint signal_num; @@ -7575,7 +7575,10 @@ gtk_widget_event_internal (GtkWidget *widget, break; } if (signal_num != -1) - g_signal_emit (widget, widget_signals[signal_num], 0, event, &return_val); + { + g_signal_emit (widget, widget_signals[signal_num], 0, event, &handled); + return_val |= handled; + } } if (WIDGET_REALIZED_FOR_EVENT (widget, event)) g_signal_emit (widget, widget_signals[EVENT_AFTER], 0, event);