Commit 38e40a55 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

widget: Add gtk_widget_set_gesture_state()

This helper function ensures the state is propagated for
all the active sequences in the given gesture.
parent 8e1d5f98
......@@ -16822,3 +16822,24 @@ gtk_widget_set_sequence_state (GtkWidget *widget,
event_widget = gtk_widget_get_parent (event_widget);
gtk_widget_set_gesture_state (GtkWidget *widget,
GtkGesture *gesture,
GtkEventSequenceState state)
GList *gestures, *l;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_IS_GESTURE (gesture));
g_return_if_fail (state >= GTK_EVENT_SEQUENCE_NONE &&
g_return_if_fail (_gtk_widget_has_gesture (widget, gesture));
gestures = gtk_gesture_get_sequences (gesture);
for (l = gestures; l; l = l->next)
gtk_widget_set_sequence_state (widget, l->data, state);
g_list_free (gestures);
......@@ -1488,6 +1488,10 @@ GDK_AVAILABLE_IN_3_14
void gtk_widget_set_sequence_state (GtkWidget *widget,
GdkEventSequence *sequence,
GtkEventSequenceState state);
void gtk_widget_set_gesture_state (GtkWidget *widget,
GtkGesture *gesture,
GtkEventSequenceState state);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment