On Sat, 9 Nov 2024 01:28:53 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> Implementation of [focus 
> delegation](https://gist.github.com/mstr2/44d94f0bd5b5c030e26a47103063aa29).

PopupWindows have to solve a similar problem; multiple nodes can receive key 
events and they all act as if they have focus. This gets (mildly) complicated 
when dealing with input methods. There may be multiple focused nodes but there 
can only be one caret so you have to have a mechanism to determine which node 
will respond to input method requests. You also have to determine when to 
enable and disable IM events at the OS level. Spinners have never dealt with 
input methods but ComboBoxes do.

I've submitted PR #1634 to get input methods working in popups. If you want 
input methods to work with focus delegation you would need to do similar 
bookkeeping.

I noticed that PopupWindows use EventRedirectors for forwarding messages. I 
didn't dig into the EventRedirector implementation but it is an existing class 
that seems to be tackling the same problem as this PR.

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

PR Comment: https://git.openjdk.org/jfx/pull/1632#issuecomment-2470845326

Reply via email to