Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Shell set bounds on multiple monitor reset to the screen center
Shell set bounds on multiple monitor reset to the screen center [message #665287] Thu, 14 April 2011 06:15
Leung Wang Hei is currently offline Leung Wang HeiFriend
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?
Previous Topic:ScrollableComposite
Next Topic:Generate a nice print output
Goto Forum:
  


Current Time: Fri Apr 26 12:46:31 GMT 2024

Powered by FUDForum. Page generated in 0.02138 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top