RFR: 8320773: [macOS] All IME input blocked

Andy Goryachev angorya at openjdk.org
Tue Nov 28 00:20:14 UTC 2023


On Mon, 27 Nov 2023 17:07:38 GMT, Martin Fox <mfox at openjdk.org> wrote:

> The changes submitted in PR #1209 broke IME input on macOS 12 and 13 (at least on Apple Silicon). Calling charactersByApplyingModifiers on an NSEvent alters its state in some way that confuses NSTextInputContext.handleEvent. The result is that all key events are discarded if an IME is active. Apple fixed this bug in macOS 14 Sonoma.
> 
> In this PR we switch to using the same Carbon call that we started using in PR #425 (jfx21) to query the keyboard layout.
> 
> This is a new implementation of the fix for [JDK-8087700](https://bugs.openjdk.org/browse/JDK-8087700) so that bug will need to be re-tested.

IME window opens (tested with Japanese input language).

Observation:
This might be an existing issue, and unrelated to the fix - the IME window opens in what appears to be incorrect location in certain situations.

My setup has two monitors and the secondary monitor (scale =1) is above the primary (retina, scale=2).  When the test app is placed on the secondary window, the IME popup appears in the wrong location、 above the cursor, outside of the viewable area):

![Screenshot 2023-11-27 at 16 06 37](https://github.com/openjdk/jfx/assets/107069028/697fc816-053c-4ae2-934b-df67baa94bc7)

At first I thought this might be due to negative coordinates, but it also happens when the secondary monitor is moved below the primary.  Depending on where the secondary is placed the IME popup may appear on the other monitor altogether.

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

PR Comment: https://git.openjdk.org/jfx/pull/1295#issuecomment-1828853089


More information about the openjfx-dev mailing list