Re: Prioritized event handlers

2024-12-09 Thread Andy Goryachev
e only have this issue in controls, then we could use input map to resolve the issue. What do you think? -andy From: openjfx-dev on behalf of Michael Strauß Date: Wednesday, November 20, 2024 at 14:36 To: Cc: openjfx-dev Subject: Re: Prioritized event handlers Hi Andy! > 1. Does

Re: Prioritized event handlers

2024-11-20 Thread Michael Strauß
Hi Andy! > 1. Does this proposal changes the way events are dispatched with respect to > priority? In other words, does it first go through the list of all handlers > registred on the leaf Node (high priority first, then lower, then lowest), > then bubble up? Or do they propagate upwards look

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, all key events

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
Dear Michael: Sorry for the late reply - you are absolutely right. I’ve tried to solve this issue with the InputMap internal event handler list, but your proposal looks much better, as it might provide a system-wide reliable way to manage event handler invocation order. Thank you -andy Fr

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
Hi Michael, Although I really like this proposal, I think it may not go quite far enough to address the concerns I raised about user event handlers. I've given it a bit more thought, and I think the following should be true for user installed handlers: 1) User event handlers should always t

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 th

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
Looks very nice Michael, I especially like the more sane behavior with regards to consumed events. I have a few questions on this: - Would an event handler like KeyEvent.ANY at Preferred priority be called before one for KeyEvent.KEY_PRESSED at Default or System priority? - The consumed flag