src/macosx/classes/sun/lwawt/LWWindowPeer.java

Print this page

        

@@ -336,10 +336,22 @@
         }
         if (h < MINIMUM_HEIGHT) {
             h = MINIMUM_HEIGHT;
         }
 
+        if (graphicsConfig instanceof TextureSizeConstraining) {
+            final int maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
+            final int maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();
+
+            if (w > maxW) {
+                w = maxW;
+            }
+            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();

@@ -403,18 +415,16 @@
         platformWindow.setModalBlocked(blocked);
     }
 
     @Override
     public void updateMinimumSize() {
-        Dimension d = null;
-        if (getTarget().isMinimumSizeSet()) {
-            d = getTarget().getMinimumSize();
-        }
-        if (d == null) {
-            d = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
+        int maxW = Integer.MAX_VALUE, maxH = Integer.MAX_VALUE;
+        if (graphicsConfig instanceof TextureSizeConstraining) {
+            maxW = ((TextureSizeConstraining)graphicsConfig).getMaxTextureWidth();
+            maxH = ((TextureSizeConstraining)graphicsConfig).getMaxTextureHeight();
         }
-        platformWindow.setMinimumSize(d.width, d.height);
+        platformWindow.setSizeConstraints(MINIMUM_WIDTH, MINIMUM_HEIGHT, maxW, maxH);
     }
 
     @Override
     public void updateIconImages() {
         getPlatformWindow().updateIconImages();