Commit 7d54fc14 authored by Bastien Nocera's avatar Bastien Nocera

GtkButton: Don't suppress unhandled mouse events

Mouse events that we do not handle should bubble up to the parent
widget, so they can be handled there, instead of disappearing inside
the button. Also use GDK_EVENT_{STOP,PROPAGATE} to make return
values clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=696640
parent 1ba8a5a1
......@@ -1818,10 +1818,13 @@ gtk_button_button_press (GtkWidget *widget,
gtk_widget_grab_focus (widget);
if (event->button == GDK_BUTTON_PRIMARY)
g_signal_emit (button, button_signals[PRESSED], 0);
{
g_signal_emit (button, button_signals[PRESSED], 0);
return GDK_EVENT_STOP;
}
}
return TRUE;
return GDK_EVENT_PROPAGATE;
}
static gboolean
......@@ -1834,9 +1837,10 @@ gtk_button_button_release (GtkWidget *widget,
{
button = GTK_BUTTON (widget);
g_signal_emit (button, button_signals[RELEASED], 0);
return GDK_EVENT_STOP;
}
return TRUE;
return GDK_EVENT_PROPAGATE;
}
static gboolean
......@@ -1852,13 +1856,15 @@ gtk_button_touch (GtkWidget *widget,
gtk_widget_grab_focus (widget);
g_signal_emit (button, button_signals[PRESSED], 0);
return GDK_EVENT_STOP;
}
else if (event->type == GDK_TOUCH_END)
{
g_signal_emit (button, button_signals[RELEASED], 0);
return GDK_EVENT_STOP;
}
return TRUE;
return GDK_EVENT_PROPAGATE;
}
static gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment