# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1323339054 0 # Node ID c50f445e891a339a418dfd54ea6e2f31e41bd019 # Parent 09fa437d6a5facc74599774f49fa0848ccaf410b Fixed auto-sizing top-level Windows on Windows... Needed to take into account border and titlebar. diff -r 09fa437d6a5f -r c50f445e891a readme --- a/readme Thu Dec 08 09:58:17 2011 +0000 +++ b/readme Thu Dec 08 10:10:54 2011 +0000 @@ -47,6 +47,8 @@ If you set the background color of a widget to DW_RGB_TRANSPARENT... it will attempt to use the background color of the parent. Several types of widgets have this set by default now. +Added faster and less buggy layout engine 2.0 for OS/2, Windows and Mac. +Fixed auto-sizing top-level windows on Windows; added on OS/2 and Mac. Fixed bubble help not being displayed on Windows. Fixed menu bar items remaining highlighted on Mac. diff -r 09fa437d6a5f -r c50f445e891a win/dw.c --- a/win/dw.c Thu Dec 08 09:58:17 2011 +0000 +++ b/win/dw.c Thu Dec 08 10:10:54 2011 +0000 @@ -6555,14 +6555,14 @@ */ if ( (width < 1 || height < 1) && (thisbox = (Box *)GetWindowLongPtr(handle, GWLP_USERDATA)) ) { - int depth = 0; + int depth = 0, border = GetSystemMetrics(SM_CXSIZEFRAME) * 2; /* Calculate space requirements */ _resize_box(thisbox, &depth, width, 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 ) width = thisbox->minwidth + border; + if ( height < 1 ) height = thisbox->minheight + GetSystemMetrics(SM_CYCAPTION) + border; } /* Finally set the size */ @@ -6642,14 +6642,14 @@ */ if ( (width < 1 || height < 1) && (thisbox = (Box *)GetWindowLongPtr(handle, GWLP_USERDATA)) ) { - int depth = 0; + int depth = 0, border = GetSystemMetrics(SM_CXSIZEFRAME) * 2; /* Calculate space requirements */ _resize_box(thisbox, &depth, width, 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 ) width = thisbox->minwidth + border; + if ( height < 1 ) height = thisbox->minheight + GetSystemMetrics(SM_CYCAPTION) + border; } /* Finally set the size */