[gtk+/gtk-3-8] GtkButton: Don't suppress unhandled mouse events
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] GtkButton: Don't suppress unhandled mouse events
- Date: Sat, 18 May 2013 12:51:13 +0000 (UTC)
commit 2b91f5de30f2e08b9d14a172a60625cd468d7d79
Author: Bastien Nocera <hadess hadess net>
Date: Tue Mar 26 14:22:10 2013 +0100
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
gtk/gtkbutton.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 3ac36a7..995f817 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1784,10 +1784,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
@@ -1800,9 +1803,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
@@ -1818,13 +1822,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]