Re: Prioritized event handlers

2024-12-09 Thread Andy Goryachev
Getting back to prioritized event handlers. > I think it would most likely be the latter, i.e. a separate "wave" for each priority where the event first tunnels down to the target, and then bubbles back up. Forgive me, this makes no sense. The point of adding priority to event h

Re: Prioritized event handlers

2024-11-20 Thread Michael Strauß
also need to fix the bug that is currently in FX where that's not the case for listeners on the same node. The rest of the questions are very specific for prioritized event handlers. But I now think that unconsumed event handlers are a much simpler solution to the problem, as it solve

Re: Prioritized event handlers

2024-11-13 Thread Andy Goryachev
Andy Goryachev Date: Monday, October 30, 2023 at 12:53 To: Michael Strauß , openjfx-dev Subject: Re: Prioritized event handlers Dear Michael: Thank you, this is very helpful. Questions/Comments: 1. Does this proposal changes the way events are dispatched with respect to priority? In other

Re: Prioritized event handlers

2024-11-12 Thread Andy Goryachev
ink? -andy From: openjfx-dev on behalf of Nir Lisker Date: Tuesday, November 12, 2024 at 10:47 To: Kevin Rushforth Cc: openjfx-dev@openjdk.org Subject: Re: Prioritized event handlers I'd like to understand the focus and event handling problem better. If I have a focused TextField, al

Re: Prioritized event handlers

2024-11-12 Thread Michael Strauß
I would encourage to continue this discussion in the focus delegation thread, not in the prioritized event handlers thread. On Tue, Nov 12, 2024 at 8:13 PM Nir Lisker wrote: > > I'd like to understand the focus and event handling problem better. If I have > a focused TextField,

Re: Prioritized event handlers

2024-11-12 Thread John Hendrikx
lto:openjfx-dev-r...@openjdk.org> on behalf of Michael Strauß <mailto:michaelstr...@gmail.com> *Date: *Friday, November 8, 2024 at 17:52 *To: * *Cc: *openjfx-dev <mailto:openjfx-dev@openjdk.org> *Subject: *Re: Prioritized event handlers Hi Andy,

Re: Prioritized event handlers

2024-11-12 Thread Nir Lisker
to one side, > but not the other? > > > > 2. For event filter in behaviors idea: how does it work when both behavior > and the application register an event filter? and then the skin is > changed? wouldn't we have the same issue? > > > > 3. Are there any example

Re: Prioritized event handlers

2024-11-12 Thread Kevin Rushforth
November 8, 2024 at 17:52 *To: * *Cc: *openjfx-dev *Subject: *Re: Prioritized event handlers Hi Andy, 1. What happened to this proposal? I've come to the conclusion that we need something like that, but probably in a different form. My current thinking is that we don't need prioritized h

Re: Prioritized event handlers

2024-11-12 Thread Andy Goryachev
v Subject: Re: Prioritized event handlers Hi Andy, 1. What happened to this proposal? I've come to the conclusion that we need something like that, but probably in a different form. My current thinking is that we don't need prioritized handlers, but merely a way for interested listene

Re: Prioritized event handlers

2024-11-11 Thread John Hendrikx
Some comments in line. On 09/11/2024 02:52, Michael Strauß wrote: Hi Andy, 1. What happened to this proposal? I've come to the conclusion that we need something like that, but probably in a different form. My current thinking is that we don't need prioritized handlers, but merely a way for int

Re: Prioritized event handlers

2024-11-08 Thread Michael Strauß
Hi Andy, 1. What happened to this proposal? I've come to the conclusion that we need something like that, but probably in a different form. My current thinking is that we don't need prioritized handlers, but merely a way for interested listeners to say "I'll take this event, but only if no one el

Re: Prioritized event handlers

2024-11-08 Thread Michael Strauß
I agree with this analysis, and I've taken the liberty to steal parts of your code for this PR: https://github.com/openjdk/jfx/pull/1632 On Thu, Nov 7, 2024 at 3:06 PM John Hendrikx wrote: > [...] > I now think Behaviors should always be doing their event handling in filters, > for the simple re

Re: Prioritized event handlers

2024-11-08 Thread Andy Goryachev
t; Date: Thursday, November 7, 2024 at 05:35 To: openjfx-dev@openjdk.org<mailto:openjfx-dev@openjdk.org> <mailto:openjfx-dev@openjdk.org> Subject: Re: Prioritized event handlers Hi Andy, Simply replacing a Skin can change the order of event handlers. In other words, if you regist

Re: Prioritized event handlers

2024-11-08 Thread Tobias Oelgarte
mplexity, including misbehaving EventDispatcher implementations. May be it's just me, I don't see the beauty of this thing. -andy *From: *openjfx-dev on behalf of John Hendrikx *Date: *Thursday, November 7, 2024 at 05:35 *To: *openjfx-dev@openjdk.org *Subject: *Re: Prioritized event

Re: Prioritized event handlers

2024-11-07 Thread John Hendrikx
y be it's just me, I don't see the beauty of this thing. -andy *From: *openjfx-dev on behalf of John Hendrikx *Date: *Thursday, November 7, 2024 at 05:35 *To: *openjfx-dev@openjdk.org *Subject: *Re: Prioritized event handlers Hi Andy, Simply replacing a Skin can change the order of eve

Re: Prioritized event handlers

2024-11-07 Thread Andy Goryachev
this thing. -andy From: openjfx-dev on behalf of John Hendrikx Date: Thursday, November 7, 2024 at 05:35 To: openjfx-dev@openjdk.org Subject: Re: Prioritized event handlers Hi Andy, Simply replacing a Skin can change the order of event handlers. In other words, if you registered your handle

Re: Prioritized event handlers

2024-11-07 Thread Andy Goryachev
? -andy From: openjfx-dev on behalf of John Hendrikx Date: Thursday, November 7, 2024 at 05:35 To: openjfx-dev@openjdk.org Subject: Re: Prioritized event handlers Hi Andy, Simply replacing a Skin can change the order of event handlers. In other words, if you registered your handler **after

Re: Prioritized event handlers

2024-11-07 Thread John Hendrikx
plit the discussion into separate threads. -andy *From: *openjfx-dev on behalf of Michael Strauß *Date: *Friday, October 27, 2023 at 19:41 *To: *openjfx-dev *Subject: *Re: Prioritized event handlers Here is the proposal: https://gist.github.com/mstr2/4bde9c97dcf608a0501030ade1ae7d

Re: Prioritized event handlers

2024-11-07 Thread Andy Goryachev
ceed with the problem of Controls. (I'll start a separate thread). What do you think? -andy From: openjfx-dev on behalf of John Hendrikx Date: Thursday, November 7, 2024 at 05:35 To: openjfx-dev@openjdk.org Subject: Re: Prioritized event handlers Hi Andy, Simply replacing a Skin

Re: Prioritized event handlers

2024-11-06 Thread Andy Goryachev
Date: Friday, October 27, 2023 at 19:41 To: openjfx-dev Subject: Re: Prioritized event handlers Here is the proposal: https://gist.github.com/mstr2/4bde9c97dcf608a0501030ade1ae7dc1 Comments are welcome. On Fri, Oct 27, 2023 at 8:21 PM Andy Goryachev wrote: > > Would it be possible to cr

Re: [External] : Re: Prioritized event handlers

2023-11-24 Thread Martin Fox
> skin change, we need at least two more. So two priorities are clearly not > enough. > > -andy > > > > > From: openjfx-dev on behalf of John Hendrikx > > Date: Tuesday, October 31, 2023 at 15:10 > To: openjfx-dev@openjdk.org > Subject: Re: [Extern

Re: [External] : Re: Prioritized event handlers

2023-10-31 Thread Andy Goryachev
t 15:10 To: openjfx-dev@openjdk.org Subject: Re: [External] : Re: Prioritized event handlers On 31/10/2023 21:03, Andy Goryachev wrote: Dear Martin: I understand John’s point: you want all the user installed filters and handlers across all levels to be processed before switching to system level proc

Re: Prioritized event handlers

2023-10-31 Thread John Hendrikx
or am I missing some critical aspect of the proposed solution? Thank you -andy *From:*openjfx-dev on behalf of Michael Strauß *Date:*Friday, October 27, 2023 at 19:41 *To:*openjfx-dev *Subject:*Re: Prioritized event handlers Here is the proposal: https://gist.github.com/mstr2/4bde9c97dcf608

Re: [External] : Re: Prioritized event handlers

2023-10-31 Thread John Hendrikx
not add any handlers, instead leaving it up to the child class?  But that’s implementation detail. What do you think? -andy *From: *Martin Fox *Date: *Tuesday, October 31, 2023 at 10:13 *To: *Andy Goryachev *Cc: *Michael Strauß , openjfx-dev *Subject: *[External] : Re: Prioritized event handl

Re: [External] : Re: Prioritized event handlers

2023-10-31 Thread Andy Goryachev
d any handlers, instead leaving it up to the child class? But that’s implementation detail. What do you think? -andy From: Martin Fox Date: Tuesday, October 31, 2023 at 10:13 To: Andy Goryachev Cc: Michael Strauß , openjfx-dev Subject: [External] : Re: Prioritized event handlers I understand J

Re: Prioritized event handlers

2023-10-31 Thread Martin Fox
the order > added. > > Would you agree, or am I missing some critical aspect of the proposed > solution? > > Thank you > -andy > > > > > > From: openjfx-dev on behalf of Michael Strauß > > Date: Friday, October 27, 2023 at 19:41

Re: Prioritized event handlers

2023-10-30 Thread Andy Goryachev
From: openjfx-dev on behalf of Michael Strauß Date: Monday, October 23, 2023 at 16:10 To: openjfx-dev Subject: Prioritized event handlers Hi Andy! In a previous mail, I observed that a method like `BehaviorBase.addHandlerLast` suggests to me that we're lacking core tools in the JavaFX fram

Re: Prioritized event handlers

2023-10-30 Thread Andy Goryachev
priority, they get invoked in the order added. Would you agree, or am I missing some critical aspect of the proposed solution? Thank you -andy From: openjfx-dev on behalf of Michael Strauß Date: Friday, October 27, 2023 at 19:41 To: openjfx-dev Subject: Re: Prioritized event handlers Here is

Re: Prioritized event handlers

2023-10-29 Thread John Hendrikx
Hi Michael, What you describe in the generalization sounds excellent, and would go a step further and avoids the registration mechanism by instead doing multiple dispatch/bubbling phases.  The registration mechanism is more a system to avoid doing that multiple times, but it could also be enfo

Re: Prioritized event handlers

2023-10-28 Thread Michael Strauß
Hi John, from what I understand, you're essentially suggesting a third phase of event dispatch: 1. The event starts at the root and travels to the event target (capturing phase) 2. If the event is not consumed, it travels back to the root, but default handlers are excluded (bubbling phase) 3. If

Re: Prioritized event handlers

2023-10-28 Thread John Hendrikx
lways take priority over internal handlers, regardless of where they are installed in the scene graph 2) Users should have control over when default handlers are allowed to consume events, without also blocking other user event handlers Your proposal with prioritized event handlers addresses this

Re: Prioritized event handlers

2023-10-27 Thread Michael Strauß
Here is the proposal: https://gist.github.com/mstr2/4bde9c97dcf608a0501030ade1ae7dc1 Comments are welcome. On Fri, Oct 27, 2023 at 8:21 PM Andy Goryachev wrote: > > Would it be possible to create a proposal in the JEP format outlining the > proposed public API? > > > > Thank you > > -andy

Re: Prioritized event handlers

2023-10-27 Thread Andy Goryachev
Would it be possible to create a proposal in the JEP format outlining the proposed public API? Thank you -andy From: openjfx-dev on behalf of Michael Strauß Date: Monday, October 23, 2023 at 16:10 To: openjfx-dev Subject: Prioritized event handlers Hi Andy! In a previous mail, I observed

Re: Prioritized event handlers

2023-10-26 Thread John Hendrikx
Hi Michael, Yeah, I also think it is an oversight, or may even be qualified as a bug.  Now you have to be really careful to start event handlers with a `if (!event.isConsumed())` check, just in case there is another handler that is before you at the same level that may have consumed the event.

Re: Prioritized event handlers

2023-10-25 Thread Michael Strauß
> - The consumed flag doesn't change any other behavior? Consumed events > only are passed to handlers at the same level, but are not bubbled up > (or captured down); having consumed events not be passed to event > handlers (even at the same level) seems like a more sane default for sure I pulled

Re: Prioritized event handlers

2023-10-24 Thread Michael Strauß
Hi John, > - Would an event handler like KeyEvent.ANY at Preferred priority be > called before one for KeyEvent.KEY_PRESSED at Default or System priority? Yes. > - The consumed flag doesn't change any other behavior? Consumed events > only are passed to handlers at the same level, but are not b

Re: Prioritized event handlers

2023-10-24 Thread John Hendrikx
JavaFX framework. In this case, we want to ensure that an event handler is always invoked before (or after) other event handlers. One way to do that might be to support prioritized event handlers at the core level, instead of creating new API that seems like a workaround. I've created a proof o

Prioritized event handlers

2023-10-23 Thread Michael Strauß
might be to support prioritized event handlers at the core level, instead of creating new API that seems like a workaround. I've created a proof of concept for prioritized event handlers [0], which might be a moderate-effort but high-value addition to JavaFX. [0] https://github.com/openjdk/jfx/pull/1266