# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1323338297 0 # Node ID 09fa437d6a5facc74599774f49fa0848ccaf410b # Parent bde7ebced556bb8e3b90f650afa53d7c43058e8a Fixed auto-sizing top-level windows in OS/2. diff -r bde7ebced556 -r 09fa437d6a5f os2/dw.c --- a/os2/dw.c Thu Dec 08 09:30:32 2011 +0000 +++ b/os2/dw.c Thu Dec 08 09:58:17 2011 +0000 @@ -6857,17 +6857,17 @@ Box *thisbox; HWND box; - if((width < 1 || height < 1) && (box = WinWindowFromID(window, FID_CLIENT)) && + if((width < 1 || height < 1) && (box = WinWindowFromID(handle, FID_CLIENT)) && (thisbox = WinQueryWindowPtr(box, QWP_USER))) { - int depth = 0; + int depth = 0, border = WinQuerySysValue(HWND_DESKTOP, SV_CXSIZEBORDER) * 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 + WinQuerySysValue(HWND_DESKTOP, SV_CYTITLEBAR) + border; } /* Finally set the size */ @@ -6943,17 +6943,17 @@ Box *thisbox; HWND box; - if((width < 1 || height < 1) && (box = WinWindowFromID(window, FID_CLIENT)) && + if((width < 1 || height < 1) && (box = WinWindowFromID(handle, FID_CLIENT)) && (thisbox = WinQueryWindowPtr(box, QWP_USER))) { - int depth = 0; + int depth = 0, border = WinQuerySysValue(HWND_DESKTOP, SV_CXSIZEBORDER) * 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 + WinQuerySysValue(HWND_DESKTOP, SV_CYTITLEBAR) + border; } /* Finally set the size */