I'm using the most recent stable version of SWT.
I have a Shell containing a ToolBar, a ScrolledComposite, and a Canvas. The Canvas is set as the ScrolledComposite's content (e.g. scrolledComposite.setContent(canvas)). The Canvas is created with a specific size that never changes (say, 400 x 400). Whereas the ScrolledComposite is constantly growing or shrinking to fill the available parent shell's client area.
I have a resize listener attached to the parent Shell that attempts to do the following: a) grow the ScrolledComposite as described above and b) center the Canvas both horizontally and vertically within the ScrolledComposite (see below for example code).
This works exactly as it should on Mac OS X, however on Windows the resize event is fired and the new locations are properly calculated but ultimately the Canvas snaps back to 0,0. One other small piece of information is that if you continuously resize the window, you can see the canvas flickering and it looks as if it's being briefly drawn at the correct location.
_shell.addListener (SWT.Resize, new Listener () {
public void handleEvent (Event e)
{
int toolBarOffset = _toolBar.getSize().y;
Rectangle clientArea = _shell.getClientArea();
_scrollComposite.setBounds(0, toolBarOffset, clientArea.width, clientArea.height - toolBarOffset);
Point canvasSize = _canvas.getSize();
int canvasX = Math.max(0, (clientArea.width / 2) - (canvasSize.x / 2));
int canvasY = Math.max(0, ((clientArea.height - toolBarOffset) / 2) - (canvasSize.y / 2));
_canvas.setLocation(canvasX, canvasY);
}
});