src/macosx/classes/sun/lwawt/LWWindowPeer.java
Print this page
@@ -313,13 +313,29 @@
// 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 = getCheckedBounds(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 getCheckedBounds(Rectangle bounds) {
+ return getCheckedBounds(bounds.x, bounds.y, bounds.width, bounds.height);
+ }
+
+ public Rectangle getCheckedBounds(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();
@@ -330,16 +346,11 @@
}
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
public Point getLocationOnScreen() {
return platformWindow.getLocationOnScreen();