Well, I’ve only tried on linux/Xinerama to be honest.
If I get the list of rectangles for the monitor and center on the first rect, it’s working.
My code is :
RectangleList rects = Desktop::getInstance().getAllMonitorDisplayAreas();
if (rects.getNumRectangles() > 1)
// Full screen on the first monitor
// Don't go fullscreen
I think there is something weird going on here then. I wonder if it’s linked to the Xinerame soname fix from the linux forum, as without the fix getAllMonitorDisplayAreas() returned only one rect of the total virtual size, and with the fix, it’s returning both rect with their respective native size.
Since I’ve done both tests at the same time, maybe I should try centreWithSize again.
In all case, the remark about specifying the monitor to centre onto still hold.