--- old/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2013-09-25 18:21:14.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/LWWindowPeer.java 2013-09-25 18:21:13.000000000 +0400 @@ -317,9 +317,25 @@ op |= SET_SIZE; } + // Don't post ComponentMoved/Resized and Paint events + // until we've got a notification from the delegate + Rectangle cb = constrainBounds(x, y, w, h); + setBounds(cb.x, cb.y, cb.width, cb.height, op, false, false); + // Get updated bounds, so we don't have to handle 'op' here manually + Rectangle r = getBounds(); + platformWindow.setBounds(r.x, r.y, r.width, r.height); + } + + public Rectangle constrainBounds(Rectangle bounds) { + return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height); + } + + public Rectangle constrainBounds(int x, int y, int w, int h) { + if (w < MINIMUM_WIDTH) { w = MINIMUM_WIDTH; } + if (h < MINIMUM_HEIGHT) { h = MINIMUM_HEIGHT; } @@ -333,13 +349,8 @@ if (h > maxH) { h = maxH; } - - // Don't post ComponentMoved/Resized and Paint events - // until we've got a notification from the delegate - setBounds(x, y, w, h, op, false, false); - // Get updated bounds, so we don't have to handle 'op' here manually - Rectangle r = getBounds(); - platformWindow.setBounds(r.x, r.y, r.width, r.height); + + return new Rectangle(x, y, w, h); } @Override