TopLevelWindow::centreAroundComponent does not seem to work correctly with multiple monitors.
I am creating a dialog window that pops up over my main application window; it only seems to work correctly on the main monitor.
Unless I’m missing something, the following code seem to fix it. This is just before the end of TopLevelWindow::centreAroundComponent:
[code] const Rectangle screenArea (getParentMonitorArea());
setBounds (jlimit (screenArea.getX(), screenArea.getX() + screenArea.getWidth() - width, x),
jlimit (screenArea.getY(), screenArea.getY() + screenArea.getHeight() - height, y),
width, height);[/code]
In case it’s not obvious, I’ve changed the second parameter for each of the jlimit calls.