Skip to content

Commit 37d7561

Browse files
author
Martin Fox
committedJan 9, 2024
8301893: IME window position is off on secondary screen
Reviewed-by: kcr, angorya
1 parent 366b062 commit 37d7561

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎modules/javafx.graphics/src/main/native-glass/mac/GlassView3D.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,10 @@ - (NSRect) firstRectForCharacterRange:(NSRange)theRange actualRange:(NSRangePoin
810810
IMLOG("firstRectForCharacterRange called %lu %lu",
811811
(unsigned long)theRange.location, (unsigned long)theRange.length);
812812
NSRect result = [self->_delegate getInputMethodCandidatePosRequest:0];
813-
NSRect screenFrame = [[NSScreen mainScreen] frame];
814-
result.origin.y = screenFrame.size.height - result.origin.y;
813+
if (NSScreen.screens.count) {
814+
NSRect screenFrame = NSScreen.screens[0].frame;
815+
result.origin.y = screenFrame.size.height - result.origin.y;
816+
}
815817
return result;
816818
}
817819

0 commit comments

Comments
 (0)
Please sign in to comment.