JDK-8301893 : IME window position is off on secondary screen
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: jfx19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2023-02-06
  • Updated: 2024-01-11
  • Resolved: 2024-01-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx22 b25Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The issue can be seen on Mac Ventura 13.1 (windows, linux - TBD) with a secondary monitor set to a different scale.  
The primary retina screen has scale=2, the secondary one has scale=1.

To reproduce:
- configure the external monitor to have scale = 1.
- add a Japanese keyboard in Settings -> Keyboard -> Text Input -> Input Sources (Japanese - Romaji)
- run attached program
- click on the text field
- press fn/🌐 key to switch input method to Japanese (alternatively, use the main toolbar [A] icon to switch the input method from a pulldown.
- type "arigatou"
- notice that the IME window appears below the text field near caret.  It does so on the primary screen.
- move the window to the secondary screen where scale == 1.
- type in "arigatou"
===> notice that the window appears above the text field, sometimes even outside of the main window.

The issue can be seen in javafx-sdk-19.0.2.1, and possibly earlier.

It is unclear whether it's a Mac-specific bug or it affects all the platforms.
Comments
Changeset: 37d7561c Author: Martin Fox <mfox@openjdk.org> Date: 2024-01-09 03:04:06 +0000 URL: https://git.openjdk.org/jfx/commit/37d7561c390f706b9e711dd535580fe5ae76e879
09-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1313 Date: 2023-12-27 00:01:10 +0000
27-12-2023

This issue is specific to the Mac. The Mac screen coordinate system is inverted compared to JavaFX. The glass code needs to flip the y coordinate based on the bounds of the primary screen but it's asking for NSScreen.mainScreen (the screen of the active window) instead of NSScreen.screens[0] (the actual primary screen).
26-12-2023