JDK-8160073 : menu issues in case of two-display configuration
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_10
  • Submitted: 2016-06-22
  • Updated: 2016-12-20
  • Resolved: 2016-08-18
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.
Related Reports
Relates :  
Relates :  
JDK9 b123 + Win. 10 + two displays (both HiDPI, but not sure if it does matter)

Please run the test code from JDK-8159968 and drag the app from the 1st display to another. Then it is impossible to select the menu items, as the menu
1. appears at a wrong place and
2. vanishes immediately when releasing the mouse button (so can't select any item).

Please see the screenshot attached. Note also that the "Minimize" button has huge size and is located under the app's icon (it appears in the leftmost corner on the screenshot) - that's NOK as well.

Looks good. I don't have a multi-mon setup on Windows, but the code looks correct and I tested that there are no regressions on Windows 10 with a single monitor. +1

The fix to the event handler screen coordinate scaling code is identical to JDK-8156094.

webrev: http://cr.openjdk.java.net/~flar/JDK-8160073/webrev.00/ This fixes both of the issues identified in the previous comment and also updates code in additional (scrolling and gesture-related) event paths to perform proper scaling of screen coordinates. Note that the new code for scaling screen coordinates in GlassViewEventHandler is copied from the menuEvent code (near line 440 in the old file) that had already been doing this scaling properly.

There are 2 HiDPI related issues going on here: - The fact that the decorations have a different size relative to the screen scale on the second window is not communicated to the FX layer so it mismanages where it locates the submenu. - There is some missing code in the glass event propagation mechanism that recalculates the screen coordinates on mouse events on secondary screens incorrectly. The screen coordinates are appropriately scaled already for menu coordinates, but the decision to show/hide the menu popup happens on regular mouse events which were not being scaled correctly.

The size of the minimize widget is due to the fact that Windows will not scale those items on displays of different DPIs (they will always be scaled for the primary monitor). We will need to update to a more modern way of managing decorated windows to get scalable decorations. The menu issue should not be happening, though.

Aug 11, 2016: pending Assignee's evaluation

This is likely a Hi-DPI issue.