On Fri, 22 Nov 2024 22:14:12 GMT, Martin Fox <m...@openjdk.org> wrote:
>> 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. @beldenfox This is now ready for you to integrate. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1634#issuecomment-2590300658