RFR: 8288893: Popup and its subclasses cannot input text from InputMethod [v3]

Martin Fox mfox at openjdk.org
Fri Nov 22 22:16:20 UTC 2024


On Fri, 22 Nov 2024 19:51:18 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Tweak to satisfy system test.
>
> I'll take a look at it after Thanksgiving.
> 
> Somewhat related questions (sorry if totally unrelated):
> 
> Q1. shouldn't the input method be tied to the `Scene.focusOwner` property somehow?
> Q2. given the fact that there could be only one active IM in the application, shouldn't there be a static `currentInputFocusOwner` property somewhere?

@andy-goryachev-oracle I'll answer your questions in reverse order.

> Q2. given the fact that there could be only one active IM in the application, shouldn't there be a static
> currentInputFocusOwner property somewhere?

It's better to think that there's a separate IM associated with each operating system window but the OS only shows one at any time. That's the way the operating system API's work.

There hasn't been any reason to track this inside JavaFX. Normally the OS tracks which Scene has focus and we track which Node is the focusOwner in that Scene and that's all the bookkeeping we need. Things only get complicated with PopupWindows.

> Q1. shouldn't the input method be tied to the Scene.focusOwner property somehow?

Normally we do connect the input method with the Scene.focusOwner. But when PopupWindows are open keyboard events from one peer window are distributed across multiple Scenes so there's more than one focusOwner we could connect the input method to. It's up to JavaFX to figure out which Scene's focusOwner is relevant.

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

PR Comment: https://git.openjdk.org/jfx/pull/1634#issuecomment-2494958752


More information about the openjfx-dev mailing list