Proposed fix for JDK-8170972

Itai itaisha at
Fri Dec 9 16:44:45 UTC 2016

It seems to me the source of the problem is line 466 in

           //TODO - testing for an instance of Stage seems wrong but works
for menus
            if (scene.getWindow() instanceof Stage) {
                layoutX = layoutX + parentBounds.getWidth() - anchorWidth;
            } else {
                layoutX = layoutX - parentBounds.getWidth() - anchorWidth;

As Popup is a Window but not a Stage, the proposed fix is to simply change
the condition to:

    if (scene.getWindow() instanceof Window)

Obviously tests need to be run to see this doesn't break anything else, but
I'm not sure how to do so. As I can't post this to the JDK bug tracking
system I'm sending this here, so I'll appreciate it is someone with access
can post it there.
If it does pass all tests, and considering it's a pretty simple change, I'd
greatly appreciate if it could find its way into the next 8 update, as it
is currently blocking a feature in a project I'm working on.

Note: I'm not sure if I have used the most up-to-date dev version for the
patch file. Also, the test itself may be redundant, as getWindow() should
always return Window, shouldn't it?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Utils.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <>

More information about the openjfx-dev mailing list