Merge branch 'wip/sadiq/fix-switch-on-touch' into 'gtk-3-24'

switch: Fix toggling switch on touch devices

See merge request GNOME/gtk!1233
This commit is contained in:
Matthias Clasen 2019-12-12 19:33:57 +00:00
commit 5df5716871

View File

@ -208,6 +208,7 @@ gtk_switch_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
gtk_widget_get_allocation (GTK_WIDGET (sw), &allocation);
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
priv->in_switch = TRUE;
/* If the press didn't happen in the draggable handle,
* cancel the pan gesture right away
@ -232,6 +233,8 @@ gtk_switch_multipress_gesture_released (GtkGestureMultiPress *gesture,
if (priv->in_switch &&
gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
gtk_switch_begin_toggle_animation (sw);
priv->in_switch = FALSE;
}
static void