JDK-8161670 : MenuItem scaling on retina (HiDPI) screens is too big
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u92
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86
  • Submitted: 2016-07-14
  • Updated: 2016-09-20
  • Resolved: 2016-08-30
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.
JDK 8
8u112Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
OS X El Capitan 10.11.5

EXTRA RELEVANT SYSTEM CONFIGURATION :
MacBook Pro (Retina, 13-inch, Late 2013)
Processor 2,8 GHz Intel Core i7
Memory 16 GB 1600 MHz DDR3
Graphics Intel Iris 1536 MB

A DESCRIPTION OF THE PROBLEM :
Given an application that uses a javafx.scene.control.MenuBar with one or more javafx.scene.control.Menu with one or more javafx.scene.control.MenuItem.

When starting my JavaFX application on a secondary monitor (through DisplayPort), and then moving the application to my built-in 13 inch retina display, the scaling of the MenuItem's are off. The text appears abnormally large and the menu renders useless (Most of the MenuItems are too big to fit inside the drop down menu)

Here's a screenshot I took after moving the application to my retina display, and then clicking my menu to see it's menuItems:

http://i.imgur.com/HjCwAZN.png



Slightly off topic: I notice a "jump" in the graphics while moving the window from one non-retina screen to a retina screen. This is no problem for me, just wondering if you are aware of that problem

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start application on non-retina screen
2. Click first menu
3. Verify it looks as it should
4. Move application window to a retina screen
5. Click first menu
6. Notice menuItem's are way too big.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected the scaling of the MenuItems to be the same as the rest of the application. Aka, the text should not be abnormally large, and all menuItems should fit inside it's menu.
ACTUAL -
The menuItem's text is not scaling properly. The text is abnormally large and all menuItems does not fit inside the Menu

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No crashes / errors

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class Main extends Application {

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

    @Override
    public void start(Stage primaryStage) throws Exception {

        VBox root = new VBox();

        MenuBar menuBar = new MenuBar();
        Menu menu1 = new Menu("Application");
        menu1.getItems().add(new MenuItem("About"));
        menu1.getItems().add(new MenuItem("Exit"));
        menuBar.getMenus().add(menu1);
        VBox.setVgrow(menuBar, Priority.ALWAYS);

        root.getChildren().add(menuBar);

        primaryStage.setScene(new Scene(root));
        primaryStage.setMinWidth(700);
        primaryStage.setMinHeight(300);
        primaryStage.show();
    }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
No workaround found.


Comments
Confirmed that it is fixed in 8u112 b06, so closing as a duplicate of JDK-8145516.
30-08-2016

This is most likely a duplicate of JDK-8145516. It is still reproducible on 8u102, but the fix for JDK-8145516 will not appear until 8u112 is out which is still baking in its release stages. I can no longer reproduce it in the latest JavaFX 8u-dev repo, though, which does have the fix. I'll wait until 8u112 is released and double check the test case is fixed in that release before I close this as a duplicate.
27-08-2016

JDK-8145516 was fixed in build 2 of 8u112, so you can test the latest public EA build: https://jdk8.java.net/download.html
27-08-2016

Aug 11, 2016: pending Assignee's evaluation
11-08-2016