RFR: 8261840: Submenus close to screen borders are no longer repositioned

Kevin Rushforth kcr at openjdk.java.net
Tue Feb 23 16:16:44 UTC 2021


On Tue, 23 Feb 2021 15:32:17 GMT, Robert Lichtenberger <rlichten at openjdk.org> wrote:

> Reverting to the old way of showing the context menu but with application
> of CSS prior to calling prefHeight(-1) / prefWidth(-1) to ensure correct
> size measurement of the menu.

modules/javafx.controls/src/main/java/javafx/scene/control/ContextMenu.java line 250:

> 248:         getScene().setNodeOrientation(anchor.getEffectiveNodeOrientation());
> 249:         if (getScene().getStylesheets().isEmpty()) {
> 250:             getScene().getStylesheets().setAll(anchor.getScene().getStylesheets());

I need to verify this, but I presume that the `Scene` of the `ContextMenu` is something that is created by JavaFX (as opposed to something that can be set by the application)? If so, then this might be an OK fix, but we will need to ensure that there are no side effects of doing this.

-------------

PR: https://git.openjdk.java.net/jfx/pull/410


More information about the openjfx-dev mailing list