RFR: 8301893: IME window position is off on secondary screen
Martin Fox
mfox at openjdk.org
Tue Jan 9 01:04:33 UTC 2024
On Tue, 9 Jan 2024 00:17:33 GMT, Andy Goryachev <angorya 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).
>
> 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?
Yes, it is entered if there's a single monitor (NSScreen.screens.count will be 1). We always have to flip the y coordinate.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1313#discussion_r1445522864
More information about the openjfx-dev
mailing list