[gtk] flowbox: Accept multipress gesture late
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] flowbox: Accept multipress gesture late
- Date: Mon, 7 Jan 2019 21:14:26 +0000 (UTC)
commit 1c14285deeb32c454f84fb0dcc3dae2459cedaee
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Jan 2 19:10:49 2019 +0100
flowbox: Accept multipress gesture late
So it's able to operate properly with the DnD gesture set by
gtk_drag_source_set(). We usually just react on button release,
that's the right time to claim the gesture.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1557
gtk/gtkflowbox.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index bfc21b5c4b..f95d8734e1 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -2634,12 +2634,15 @@ gtk_flow_box_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
if (n_press != 1)
gtk_gesture_set_state (priv->drag_gesture, GTK_EVENT_SEQUENCE_DENIED);
- gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
priv->active_child = child;
gtk_widget_queue_draw (GTK_WIDGET (box));
if (n_press == 2 && !priv->activate_on_single_click)
- g_signal_emit (box, signals[CHILD_ACTIVATED], 0, child);
+ {
+ gtk_gesture_set_state (GTK_GESTURE (gesture),
+ GTK_EVENT_SEQUENCE_CLAIMED);
+ g_signal_emit (box, signals[CHILD_ACTIVATED], 0, child);
+ }
}
static void
@@ -2674,6 +2677,9 @@ gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture,
if (priv->active_child != NULL &&
priv->active_child == gtk_flow_box_get_child_at_pos (box, x, y))
{
+ gtk_gesture_set_state (GTK_GESTURE (gesture),
+ GTK_EVENT_SEQUENCE_CLAIMED);
+
if (priv->activate_on_single_click)
gtk_flow_box_select_and_activate (box, priv->active_child);
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]