[gtk/wip/carlosg/sequence-state-fixups: 40/40] gtktext: Don't accept (twice!) all press actions
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/sequence-state-fixups: 40/40] gtktext: Don't accept (twice!) all press actions
- Date: Fri, 26 Jun 2020 15:49:34 +0000 (UTC)
commit 0ce4f669769fececfe93b2ca2c4006c34e1a3b3d
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jun 26 17:36:37 2020 +0200
gtktext: Don't accept (twice!) all press actions
The gesture should claim the sequence after triggering uncancellable
actions, like pasting, showing a menu or selecting words/lines. A
single first button press initiating a drag does not trigger
anything yet, so it should avoid claiming the sequence.
gtk/gtktext.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 776bb421c7..178bed2460 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]