[gtk/wip/carlosg/flowbox-late-claim] flowbox: Accept multipress gesture late
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/flowbox-late-claim] flowbox: Accept multipress gesture late
- Date: Wed, 2 Jan 2019 20:11:44 +0000 (UTC)
commit c4949aef098e31d10eb13691a15912a6c9c975f3
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 3f204b9a57..d8c469b7fa 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -3032,13 +3032,16 @@ 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;
priv->active_child_active = TRUE;
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
@@ -3052,6 +3055,9 @@ gtk_flow_box_multipress_gesture_released (GtkGestureMultiPress *gesture,
if (priv->active_child != NULL && priv->active_child_active)
{
+ 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]