src/macosx/classes/sun/lwawt/LWWindowPeer.java
Print this page
*** 315,327 ****
--- 315,343 ----
// no need to add insets since Window's notion of width and height includes insets.
op &= ~SET_CLIENT_SIZE;
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;
}
final int maxW = getLWGC().getMaxTextureWidth();
*** 332,347 ****
}
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);
}
@Override
public Point getLocationOnScreen() {
return platformWindow.getLocationOnScreen();
--- 348,358 ----
}
if (h > maxH) {
h = maxH;
}
! return new Rectangle(x, y, w, h);
}
@Override
public Point getLocationOnScreen() {
return platformWindow.getLocationOnScreen();