Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8120239

Window.setMenuBar() should only be used on Mac OS X

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx2.1
    • fx2.1
    • javafx
    • None
    • MS Windows

      RT-19578 resolved an issue in Glass making it possible to suppress system default handling of F10 or ALT key presses. This disables activating the window system menu, and allows FX to navigate its own, drawn FX menu with arrow keys.

      Glass also allows its client to set a native menu bar on MS Windows platform in which case the workaround is disabled to allow activating the native menu bar when pressing F10 or ALT. Adding an empty native menu to a window won't be noticeable visually, however, Glass will still consider that this is a non-NULL menu, and hence disable the workaround.

      It appears that Quantum sets a native menu for all windows unconditionally (see WindowStage.java and calls to setMenuBar()). This makes the workaround implemented at Glass turned off, and as such navigating of FX menus with keyboard doesn't work properly. To reproduce run the HelloMenu toy on MS Windows, press F10 or ALT and then press ArrowDown key. If the system menu pops up, the bug is reproduced.

      To fix this issue, Quantum shouldn't set a native menu bars when it is not needed. In fact the native menu needs only be set on the Mac OS X platform.

            morris Morris Meyer (Inactive)
            anthony Anthony Petrov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: