[gtk+/gestures: 142/173] widget: Fix gesture event handler retval for bubbled events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gestures: 142/173] widget: Fix gesture event handler retval for bubbled events
- Date: Fri, 16 May 2014 17:12:19 +0000 (UTC)
commit 81af969575c0134efedaa58650f3b23338d181a3
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed May 7 19:06:42 2014 +0200
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 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index e9f37ed..dc7fd0b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7458,7 +7458,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,
@@ -7471,8 +7471,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;
@@ -7574,7 +7574,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]