[gtk/columnview-double-activation] listitemwidget: Claim gesture when activating
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/columnview-double-activation] listitemwidget: Claim gesture when activating
- Date: Sat, 12 Jun 2021 14:25:30 +0000 (UTC)
commit 3e3aae26a52e02fdf1367dd00daf96b87faefc4c
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 12 10:23:23 2021 -0400
listitemwidget: Claim gesture when activating
Otherwise we end up with double activations in
columnviews: first GtkColumnViewCell handles
the event, and then GtkListItemWidget.
Fixes: #4015
gtk/gtklistitemwidget.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c
index 2a98ef5c87..2e47dec376 100644
--- a/gtk/gtklistitemwidget.c
+++ b/gtk/gtklistitemwidget.c
@@ -334,10 +334,8 @@ gtk_list_item_widget_click_gesture_pressed (GtkGestureClick *gesture,
{
if (n_press == 2 && !priv->single_click_activate)
{
- gtk_widget_activate_action (GTK_WIDGET (self),
- "list.activate-item",
- "u",
- priv->position);
+ gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
+ gtk_widget_activate_action (GTK_WIDGET (self), "list.activate-item", "u", priv->position);
}
}
@@ -356,14 +354,15 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick *gesture,
{
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
- if (priv->single_click_activate)
+ if (!priv->list_item || priv->list_item->activatable)
{
- gtk_widget_activate_action (GTK_WIDGET (self),
- "list.activate-item",
- "u",
- priv->position);
+ if (n_press == 1 && priv->single_click_activate)
+ {
+ gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
+ gtk_widget_activate_action (GTK_WIDGET (self), "list.activate-item", "u", priv->position);
- return;
+ return;
+ }
}
if (!priv->list_item || priv->list_item->selectable)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]