jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java
changeset 20457 ecb935d774a3
parent 20448 0eef03207781
child 21247 40e9d768d8e2
--- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Mon Oct 07 16:13:48 2013 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java	Mon Oct 07 16:42:29 2013 +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;
         }
@@ -334,12 +350,7 @@
             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