Commit d17fd81d authored by Carlos Garnacho's avatar Carlos Garnacho

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
parent fcec9b98
......@@ -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
......
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