Proposed fix for JDK-8170972

Jonathan Giles jonathan.giles at
Fri Dec 9 21:02:25 UTC 2016

Thanks for sending in this patch - I have attached it to the jira issue 
on your behalf.

-- Jonathan

On 9/12/16 8:44 AM, Itai wrote:
> It seems to me the source of the problem is line 466 in
> com.sun.javafx.util.Utils:
>             //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?
> Regards,
> Itai.

More information about the openjfx-dev mailing list