Merge branch 'wip/carlosg/sequence-state-fixups' into 'master'

Fixups to gesture sequence states

Closes #2895

See merge request GNOME/gtk!2154
This commit is contained in:
Matthias Clasen 2020-06-26 17:08:09 +00:00
commit 9b9a9f14e2
2 changed files with 7 additions and 7 deletions

View File

@ -205,8 +205,6 @@ gtk_switch_click_gesture_pressed (GtkGestureClick *gesture,
if (!gtk_widget_compute_bounds (GTK_WIDGET (self), GTK_WIDGET (self), &switch_bounds))
return;
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
/* If the press didn't happen in the draggable handle,
* cancel the pan gesture right away
*/
@ -228,7 +226,10 @@ gtk_switch_click_gesture_released (GtkGestureClick *gesture,
if (gtk_widget_contains (GTK_WIDGET (self), x, y) &&
gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
gtk_switch_begin_toggle_animation (self);
{
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
gtk_switch_begin_toggle_animation (self);
}
}
static void

View File

@ -2667,8 +2667,6 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), current);
gtk_gesture_set_sequence_state (GTK_GESTURE (gesture), current,
GTK_EVENT_SEQUENCE_CLAIMED);
gesture_get_current_point_in_layout (GTK_GESTURE_SINGLE (gesture), self, &x, &y);
gtk_text_reset_blink_time (self);
@ -2816,12 +2814,13 @@ gtk_text_click_gesture_pressed (GtkGestureClick *gesture,
gtk_text_set_positions (self, end, start);
}
gtk_gesture_set_state (priv->drag_gesture,
GTK_EVENT_SEQUENCE_CLAIMED);
gtk_text_update_handles (self);
}
if (button != GDK_BUTTON_PRIMARY || n_press >= 3)
gtk_gesture_set_state (priv->drag_gesture, GTK_EVENT_SEQUENCE_CLAIMED);
if (n_press >= 3)
gtk_event_controller_reset (GTK_EVENT_CONTROLLER (gesture));
}