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
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:

protected Rectangle getConstrainedShellBounds(Rectangle preferredSize) {
Rectangle rect = super.getConstrainedShellBounds(preferredSize);
if (rect.x > 1) {
return rect;

Am I missing something?
Previous Topic:ScrollableComposite
Next Topic:Generate a nice print output
Goto Forum:

Current Time: Sat Jan 23 10:22:35 GMT 2021

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

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

Back to the top