Skip to content

Commit

Permalink
8189282: JavaFX: Invalid position of candidate pop-up of InputMethod …
Browse files Browse the repository at this point in the history
…in Hi-DPI on Windows

8254126: the position of Chinese Input Method candidates window is wrong

Reviewed-by: kcr, arapte
  • Loading branch information
Martin Fox committed Jan 10, 2024
1 parent 37d7561 commit 5b1fce5
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,19 @@ public double[] getInputMethodCandidatePos(int offset) {
double[] ret = new double[2];
ret[0] = p2d.getX();
ret[1] = p2d.getY();

View view = scene.getPlatformView();
if (view != null) {
Window window = view.getWindow();
if (window != null) {
Screen screen = window.getScreen();
if (screen != null) {
ret[0] = screen.toPlatformX((float) p2d.getX());
ret[1] = screen.toPlatformY((float) p2d.getY());
}
}
}

return ret;
}

Expand Down

0 comments on commit 5b1fce5

Please sign in to comment.