widget: Only deny a sequence if it was previously claimed

Before this change, a sequence being claimed deep in the event propagation
chain would make the sequence go denied on every ancestor, regardless of
previous state.

To make things more consistent, only deny the sequence if it was previously
claimed, so the behavior is the same for gesture groups within the widget
than for those outside the widget.

The gestures testsuite has been updated to reflect this new behavior.
This commit is contained in:
Carlos Garnacho 2014-06-02 17:38:46 +02:00
parent c773859c99
commit 26ced6abad
2 changed files with 3 additions and 8 deletions

View File

@ -4287,6 +4287,9 @@ _gtk_widget_set_sequence_state_internal (GtkWidget *widget,
else
continue;
}
else if (!group &&
gtk_gesture_get_sequence_state (gesture, sequence) != GTK_EVENT_SEQUENCE_CLAIMED)
continue;
g_signal_handler_block (data->controller, data->sequence_state_changed_id);
retval = gtk_gesture_set_sequence_state (gesture, seq, gesture_state);

View File

@ -347,8 +347,6 @@ test_claim_capture (void)
"capture a1, "
"capture b1, "
"capture c1, "
"b1 state denied, "
"a1 state denied, "
"c1 state claimed");
g_string_free (str, TRUE);
@ -393,9 +391,6 @@ test_claim_target (void)
"capture b1, "
"capture c1, "
"target c2, "
/* "c1 state denied, " ? */
"b1 state denied, "
"a1 state denied, "
"c2 state claimed");
g_string_free (str, TRUE);
@ -445,7 +440,6 @@ test_claim_bubble (void)
"c3 cancelled, "
"c2 cancelled, "
"c1 cancelled, "
"a1 state denied, "
"b3 state claimed"
);
@ -494,8 +488,6 @@ test_group (void)
"capture b1, "
"capture c1, "
"target c3, "
"b1 state denied, "
"a1 state denied, "
"c3 state claimed, "
"c2 state claimed, "
"target c2");