RFR: 8337246: SpinnerSkin does not consume ENTER KeyEvent when editor ActionEvent is consumed

Andy Goryachev angorya at openjdk.org
Thu Aug 8 20:33:35 UTC 2024


On Tue, 30 Jul 2024 18:26:21 GMT, Andy Goryachev <angorya at 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.

Yeah, that's why I tried to hide this from the public.  I see the whole create-multiple-events idea as a _bad design_ (tm), so the proposed change is a hack^H^H^H workaround to be used internally by FX in a few specific cases (Note1).  The current PR also makes the fix localized to the specific scenario, further reducing the regression risk.

I don't think this functionality should be made public, contrary to what @mstr2 and @kleopatra say (sorry!).  I don't have any better ideas, and let's admit it, the current event dispatching paradigm will never be changed.

Note 1:

There might be more scenarios where FX needs to know whether any of the secondary events got consumed.  It's unlikely that trivial use of FX triggers the issue, but we can look through the bug list to see if we have any more mentioning `isConsumed()`.

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

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


More information about the openjfx-dev mailing list