Shell set bounds on multiple monitor reset to the screen center [message #665287] |
Thu, 14 April 2011 06:15 |
Leung Wang Hei Messages: 64 Registered: July 2010 |
Member |
|
|
I have 2 monitors side by side, A+B (Win XPP)
when I align my shell to the right edge of monitor A, it always reset to
the center of B. See the following example:
A: 2560x1600
B: 1200x1600
When I set my shell to Rectangle {2360, 1, 200, 200}, the shell is
centered at B.
It works fine if I make the x as 2359.
The above workaround does not work for Window.constrainShellSize() as
the x is auto-determined.
Here is my workaround by overriding getConstrainedShellBounds() but it a
bit ugly:
@Override
protected Rectangle getConstrainedShellBounds(Rectangle preferredSize) {
Rectangle rect = super.getConstrainedShellBounds(preferredSize);
if (rect.x > 1) {
rect.x--;
}
return rect;
}
Am I missing something?
|
|
|
Powered by
FUDForum. Page generated in 0.03102 seconds