--- old/modules/javafx.controls/src/main/java/javafx/scene/control/skin/MenuBarSkin.java 2016-10-05 11:30:40.000000000 +1300 +++ new/modules/javafx.controls/src/main/java/javafx/scene/control/skin/MenuBarSkin.java 2016-10-05 11:30:40.000000000 +1300 @@ -437,7 +437,11 @@ }); } - private void showMenu(Menu menu, boolean keyboardDriven) { + private void showMenu(Menu menu) { + showMenu(menu, false); + } + + private void showMenu(Menu menu, boolean selectFirstItem) { // hide the currently visible menu, and move to the next one if (openMenu == menu) return; if (openMenu != null) { @@ -446,7 +450,7 @@ openMenu = menu; if (!menu.isShowing() && !isMenuEmpty(menu)) { - if (keyboardDriven) { + if (selectFirstItem) { // put selection / focus on first item in menu MenuButton menuButton = getNodeForMenu(focusedMenuIndex); Skin skin = menuButton.getSkin(); @@ -939,7 +943,7 @@ openMenuButton.hide(); } openMenuButton = menuButton; - showMenu(menu, false); + showMenu(menu); } }); @@ -948,7 +952,7 @@ // check if the owner window has focus if (menuButton.getScene().getWindow().isFocused()) { - showMenu(menu, false); + showMenu(menu); // update FocusedIndex menuModeStart(getMenuBarButtonIndex(menuButton)); } @@ -975,7 +979,7 @@ } updateFocusedIndex(); if (openMenu != null && openMenu != menu) { - showMenu(menu, false); + showMenu(menu); } } }); @@ -1066,7 +1070,9 @@ findSibling(dir, focusedMenuIndex).ifPresent(p -> { setFocusedMenuIndex(p.getValue()); if (doShow) { - showMenu(p.getKey(), true); + // we explicitly do *not* allow selection - we are moving + // to a sibling menu, and therefore selection should be reset + showMenu(p.getKey(), false); } }); }