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.

> * Implement [JDK-8303209](https://bugs.openjdk.org/browse/JDK-8303209)
> * Specify that `dispatchEvent` must only return `null` if the event was 
> consumed.
> * Explicitly document that `Event.isConsumed()` can only be used inside of an 
> event handler, but not to detect whether an event was consumed at the place 
> where the event is fired.

I am afraid this makes no sense to me.  I still think the root cause of the 
issue(s) is the cloning of events, where the cloning code ignores the possible 
consumption of the secondary events.

I don't think we should redefine semantics of `Event.isConsumed()`, this method 
worked well in AWT/Swing and elsewhere (QT).

If anything, the code that clones an event for the purposes of changing its 
target needs to look at the isConsumed() flag and propagate it to the original 
event.  The problem is that `Event.copyFor()` is also used for other purposes 
as well.

Looks like we've reached an impasse (again).

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

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

Reply via email to