RFR: 8301893: IME window position is off on secondary screen
Andy Goryachev
angorya at openjdk.org
Tue Jan 9 00:27:31 UTC 2024
On Wed, 27 Dec 2023 00:01:10 GMT, Martin Fox <mfox at openjdk.org> wrote:
> The Mac screen coordinate system is inverted on the y-axis compared to JavaFX so glass needs to flip the y coordinate. IM coordinates are relative to the primary screen which is NSScreen.screens[0], not NSScreen.mainScreen (mainScreen is the screen that contains the window that has focus).
The fix looks good.
While testing, I noticed a different issue:
- switch input language to Japanese, start typing `arigato` until the candidate list popup appears
- backspace to remove the popup
- move the application window
- type something to bring the IME popup again
I expect the IME popup to appear below the new caret position, but instead it pops up where it used to be:

This might be a platform issue, since it can also be reproduced with TextEdit. Could you please confirm?
modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m line 814:
> 812: NSRect result = [self->_delegate getInputMethodCandidatePosRequest:0];
> 813: if (NSScreen.screens.count) {
> 814: NSRect screenFrame = NSScreen.screens[0].frame;
I assume this code block is not entered in the case of a single monitor?
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1313#issuecomment-1882041019
PR Review Comment: https://git.openjdk.org/jfx/pull/1313#discussion_r1445502243
More information about the openjfx-dev
mailing list