On Tue, 30 Jul 2024 18:26:21 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

> Enable backpropagation of `isConsumed` flag to the ancestor(s) of events 
> cloned via `Event.copyFor()`.
> 
> This change has a minimal API impact and allows for a fine-grained control of 
> when to propagate and when not to propagate.
> 
> The proposed change could make 
> [JDK-8303209](https://bugs.openjdk.org/browse/JDK-8303209) unnecessary.

This PR assumes that during dispatch events are copied using copyFor. But the 
documentation states that an EventDispatcher can do whatever it wants in 
`dispatchEvent`. A developer could provide a dispatcher that creates entirely 
new events rather than just copy existing ones and that would break this code. 
The only thing that’s guaranteed is that the dispatcher will return null to 
stop event dispatch and that's all that the solution in 
[JDK-8303209](https://bugs.openjdk.org/browse/JDK-8303209) relies on.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1523#issuecomment-2276166334

Reply via email to