# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1324547582 0 # Node ID 7216f4301364bf1b1859836b09e422278256c46a # Parent 9097a5eb144c078b1ada8f4675c7ac4e62de327d Fix mixing frame and content sizes on the Mac. diff -r 9097a5eb144c -r 7216f4301364 mac/dw.m --- a/mac/dw.m Wed Dec 21 13:21:39 2011 +0000 +++ b/mac/dw.m Thu Dec 22 09:53:02 2011 +0000 @@ -8443,8 +8443,11 @@ { NSWindow *window = handle; Box *thisbox; - NSSize size; + NSRect content, frame = NSMakeRect(0, 0, width, height); + /* Convert the external frame size to internal content size */ + content = [NSWindow contentRectForFrameRect:frame styleMask:[window styleMask]]; + /* * The following is an attempt to dynamically size a window based on the size of its * children before realization. Only applicable when width or height is less than one. @@ -8457,14 +8460,12 @@ _resize_box(thisbox, &depth, (int)width, (int)height, 1); /* Might need to take into account the window border here */ - if(width < 1) width = thisbox->minwidth; - if(height < 1) height = thisbox->minheight; + if(width < 1) content.size.width = thisbox->minwidth; + if(height < 1) content.size.height = thisbox->minheight; } /* Finally set the size */ - size.width = width; - size.height = height; - [window setContentSize:size]; + [window setContentSize:content.size]; } DW_MUTEX_UNLOCK; }