diff -r 5f4b2dc52be7 modules/controls/src/main/java/javafx/scene/control/ContextMenu.java --- a/modules/controls/src/main/java/javafx/scene/control/ContextMenu.java Wed Oct 02 15:04:32 2013 -0700 +++ b/modules/controls/src/main/java/javafx/scene/control/ContextMenu.java Tue Oct 08 16:03:06 2013 -0700 @@ -241,7 +241,14 @@ if (getItems().size() == 0) return; getScene().setNodeOrientation(anchor.getEffectiveNodeOrientation()); - + //RT-27546 : The problem here is before the first show the content of the popup + // is not initialized yet and hence the prefWidth & prefHeight remains 0 + // This leads to incorrect translation of anchor to screen coordinates. + // A call to show initializes the content. Skin is null only the very first time. + if(getSkin() == null) { + hide(); + super.show(anchor, dx, dy); + } // FIXME because Side is not yet in javafx.geometry, we have to convert // to the old HPos/VPos API here, as Utils can not refer to Side in the // charting API.