From f251c5bf941de94ef46b3b3a869c7d761961cb6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 1 Feb 2017 21:03:39 +0100 Subject: [PATCH] spinbutton: Fix right and middle click on +/- buttons Tell the gesture that we handle all buttons and actually claim the gesture in the ::pressed handler --- gtk/gtkspinbutton.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index c0babe6dc4..b0b15c7b11 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -761,6 +761,8 @@ button_pressed_cb (GtkGestureMultiPress *gesture, gtk_widget_grab_focus (GTK_WIDGET (spin_button)); + gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); + if (gtk_editable_get_editable (GTK_EDITABLE (spin_button))) { int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)); @@ -856,6 +858,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->gadget), -1, priv->down_button); priv->down_click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (priv->down_button)); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->down_click_gesture), 0); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->down_click_gesture), FALSE); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->down_click_gesture), GTK_PHASE_CAPTURE); @@ -869,6 +872,7 @@ gtk_spin_button_init (GtkSpinButton *spin_button) gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->gadget), -1, priv->up_button); priv->up_click_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (priv->up_button)); + gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->up_click_gesture), 0); gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->up_click_gesture), FALSE); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->up_click_gesture), GTK_PHASE_CAPTURE);