I noticed that if I add a GestureClick controller to a window and listen to pressed and released, if PropagationPhase is BUBBLE and I click on a button I don’t get the released event. If PropagationPhase is CAPTURE it works:
If an event is claimed, then its propagation stops.
I suppose the button’s internal gesture gets processed before yours, so you don’t get it afterwards (note that there is no guarantee in which order gestures are processed if they have the same propagation mode).
Putting your gesture in CAPTURE mode ensures it’s processed before the BUBBLE ones.
I understand this, my question is why only the released is not received? If it is CLAIMED, why the pressed is not CLAIMED too? Why is the handling not symmetric?
That depends on the features and what is done in the callbacks.
Claiming an event is basically for ensuring only one thing is done on the event, to prevent side-effects or allow/block some fallback behavior.
Looking at the internal handlers of pressed and released, only released is claimed.
The pressed only does focus-related stuff, so no real reason to claim the event, especially in CAPTURE mode. The released does the widget activation, so claiming makes sense there.