mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 14:20:21 +00:00
textview: Make multipress gesture accept all buttons
That gesture is meant to handle clicks on multiple buttons, so unset the GDK_BUTTON_PRIMARY default. Also, remove unnecessary boilerplate with the new GtkGestureSingle/GtkEventController defaults. https://bugzilla.gnome.org/show_bug.cgi?id=734285
This commit is contained in:
parent
af5a03c841
commit
c5839708cc
@ -1540,21 +1540,12 @@ gtk_text_view_init (GtkTextView *text_view)
|
|||||||
gtk_widget_set_redraw_on_allocate (widget, FALSE);
|
gtk_widget_set_redraw_on_allocate (widget, FALSE);
|
||||||
|
|
||||||
priv->multipress_gesture = gtk_gesture_multi_press_new (widget);
|
priv->multipress_gesture = gtk_gesture_multi_press_new (widget);
|
||||||
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->multipress_gesture),
|
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
|
||||||
FALSE);
|
|
||||||
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture),
|
|
||||||
GTK_PHASE_BUBBLE);
|
|
||||||
g_signal_connect (priv->multipress_gesture, "pressed",
|
g_signal_connect (priv->multipress_gesture, "pressed",
|
||||||
G_CALLBACK (gtk_text_view_multipress_gesture_pressed),
|
G_CALLBACK (gtk_text_view_multipress_gesture_pressed),
|
||||||
widget);
|
widget);
|
||||||
|
|
||||||
priv->drag_gesture = gtk_gesture_drag_new (widget);
|
priv->drag_gesture = gtk_gesture_drag_new (widget);
|
||||||
gtk_gesture_single_set_touch_only (GTK_GESTURE_SINGLE (priv->drag_gesture),
|
|
||||||
FALSE);
|
|
||||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->drag_gesture),
|
|
||||||
GDK_BUTTON_PRIMARY);
|
|
||||||
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture),
|
|
||||||
GTK_PHASE_BUBBLE);
|
|
||||||
g_signal_connect (priv->drag_gesture, "drag-update",
|
g_signal_connect (priv->drag_gesture, "drag-update",
|
||||||
G_CALLBACK (gtk_text_view_drag_gesture_update),
|
G_CALLBACK (gtk_text_view_drag_gesture_update),
|
||||||
widget);
|
widget);
|
||||||
|
Loading…
Reference in New Issue
Block a user