Re: Unconsumed event handlers

2024-11-13 Thread Andy Goryachev
ohn Hendrikx Date: Tuesday, November 12, 2024 at 12:18 To: openjfx-dev@openjdk.org Subject: Re: Unconsumed event handlers On 12/11/2024 18:31, Andy Goryachev wrote: I am not sure this is the best solution, since it does not solve the problem of multiple actors adding their event handlers.

Re: Unconsumed event handlers

2024-11-12 Thread John Hendrikx
On 12/11/2024 18:31, Andy Goryachev wrote: I am not sure this is the best solution, since it does not solve the problem of multiple actors adding their event handlers. I do like the idea of prioritized event handlers, because it solves the problem **reliably**. I think there is no way arou

Re: Unconsumed event handlers

2024-11-12 Thread Martin Fox
John, The issue occurs inside the event dispatchers. An event is passed into dispatchEvent which may return a separate event. What state is carried over from the incoming event to the outgoing event? If there are unconsumed event handlers attached to the incoming event are they also attached

Re: Unconsumed event handlers

2024-11-12 Thread John Hendrikx
current dispatch ends without consuming an event”. The unconsumed event handlers would then be attached to the dispatch chain instead of the event. And that’s about as far as I’ve thought this through. Martin On Nov 12, 2024, at 5:02 AM, John Hendrikx wrote: I think `discardUnconsumedEventH

Re: Unconsumed event handlers

2024-11-12 Thread Martin Fox
hand-waving and speculation. Perhaps this should be divorced from events and reframed in terms of the dispatch process. Instead of “do this if this event is not consumed” it’s “do this if the current dispatch ends without consuming an event”. The unconsumed event handlers would then be attached to

Re: Unconsumed event handlers

2024-11-12 Thread Andy Goryachev
rk. What do you think? -andy From: openjfx-dev on behalf of Michael Strauß Date: Saturday, November 9, 2024 at 23:13 To: openjfx-dev Subject: Unconsumed event handlers In JavaFX, user code and skins share the same event system. Since invocation order is fundamentally important for events, this l

Re: Unconsumed event handlers

2024-11-12 Thread John Hendrikx
using a much simpler solution: unconsumed event handlers. We add a new method to the `Event` class: void ifUnconsumed(EventHandler handler) When an event filter or an event handler receives an event, it calls the `ifUnconsumed` method with another event handler. Then, after both phases of

Unconsumed event handlers

2024-11-09 Thread Michael Strauß
are quite difficult to get right. Instead, I think we can get almost all of the benefits using a much simpler solution: unconsumed event handlers. We add a new method to the `Event` class: void ifUnconsumed(EventHandler handler) When an event filter or an event handler receives an event, it