changeset 1439:09fa437d6a5f

Fixed auto-sizing top-level windows in OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 08 Dec 2011 09:58:17 +0000
parents bde7ebced556
children c50f445e891a
files os2/dw.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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 */