summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-09-25 15:24:46 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-09-25 21:25:52 +0200
commitd17fd81d9b631acf76273b9dca2700250cbbe096 (patch)
treee7d920a57a91c7b06efaf76af06bf9fbe6b8009b /gtk/gtkbutton.c
parentfcec9b98127cf7dcb63be475490f095db1bc6faa (diff)
downloadgtk+-d17fd81d9b631acf76273b9dca2700250cbbe096.tar.gz
button: Fix ::clicked emission on touchscreens sending pointer events
When GtkGestureMultiPress::released happens, in_button should be unset after emitting GtkButton::released, whose default implementation uses it. Moreover, in_button should only be unset there for real touch events, not guaranteed to trigger crossing events, as opposed to every pointer/touch events from touchscreens. https://bugzilla.gnome.org/show_bug.cgi?id=737297
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 4f0fdc1936..207bcbcaca 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -607,18 +607,16 @@ multipress_released_cb (GtkGestureMultiPress *gesture,
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
GdkEventSequence *sequence;
- const GdkEvent *event;
- GdkDevice *source;
+
+ g_signal_emit (button, button_signals[RELEASED], 0);
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
- event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
- if (event)
+
+ if (sequence)
{
- source = gdk_event_get_source_device (event);
- if (source && gdk_device_get_source (source) == GDK_SOURCE_TOUCHSCREEN)
- priv->in_button = FALSE;
+ priv->in_button = FALSE;
+ gtk_button_update_state (button);
}
- g_signal_emit (button, button_signals[RELEASED], 0);
}
static void