JDK-8185243 : Menu misalignment when using dual monitor setup
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u141
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: x86
  • Submitted: 2017-07-24
  • Updated: 2017-07-25
  • Resolved: 2017-07-25
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) Client VM (build 25.141-b15, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.14393]

A DESCRIPTION OF THE PROBLEM :
I originally submitted bug JDK-8184968 which has been closed and I have been asked to open again trying on 8u141.
The same issue arises which is:

Using Windows 10 with a dual hi dpi monitor setup.
Monitor 1 has a resolution of 3360x2100
Monitor 2 has a resolution of 4096x2034

Monitor 1 is set as the main display.

If you run the test program and drag it to Monitor 2, you will notice that the menu is not aligned. I.e depending where the app is on the screen when you select the menu with the mouse, the actual menu pop up will be on another part of the screen. 

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the test application, drag it to the second monitor and select a menu item.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The menu should be aligned with the menu item selected.
ACTUAL -
The menu is not aligned with the menu selected.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.Application; 
import javafx.scene.*; 
import javafx.scene.control.*; 
import javafx.scene.layout.VBox; 
import javafx.stage.Stage; 

public class MenuApp extends Application { 

    public Parent createContent() { 

        VBox vbox = new VBox(20); 
        vbox.setPrefSize(300, 200); 
        final MenuBar menuBar = new MenuBar(); 
        Menu m1 = new Menu("one"); 
        m1.getItems().addAll(new MenuItem("111"), new MenuItem("222")); 
        Menu m2 = new Menu("two"); 
        m2.getItems().addAll(new MenuItem("aaa"), new MenuItem("bbb")); 
        Menu menu = new Menu("menu"); 
        menu.getItems().addAll(m1, m2); 
        menuBar.getMenus().addAll(menu); 
        vbox.getChildren().addAll(menuBar); 
        return vbox; 
        
        
    } 

    @Override 
    public void start(Stage primaryStage) throws Exception { 
        primaryStage.setScene(new Scene(createContent())); 
        primaryStage.show(); 
    } 

    public static void main(String[] args) { launch(args); } 
} 
---------- END SOURCE ----------


Comments
Closing as duplicate of JDK-8184968
25-07-2017