Ignore:
Timestamp:
Jan 14, 2000, 2:16:59 PM (26 years ago)
Author:
sandervl
Message:

Several window position bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32wbasepos.cpp

    r2433 r2435  
    1 /* $Id: win32wbasepos.cpp,v 1.6 2000-01-13 20:11:39 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.7 2000-01-14 13:16:59 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    134134        winposCopy = *winpos;
    135135        params.rgrc[1] = *oldWindowRect;
    136 #if 0
    137136        if(getParent()) {//in parent coordinates
    138137            MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), (POINT *)oldClientRect, 2);
     
    141140            OffsetRect(oldClientRect, rectWindow.left, rectWindow.top);
    142141        }
    143 #endif
    144142        params.rgrc[2] = *oldClientRect;
    145143        params.lppos = &winposCopy;
    146144   }
    147145   result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect, (LPARAM)&params );
    148    if (calcValidRect)
     146
     147   /* If the application send back garbage, ignore it */
     148   if (params.rgrc[0].left <= params.rgrc[0].right && params.rgrc[0].top <= params.rgrc[0].bottom)
    149149   {
    150       /* If the application send back garbage, ignore it */
    151       if (params.rgrc[2].left <= params.rgrc[2].right && params.rgrc[2].top <= params.rgrc[2].bottom)
    152       {
    153         *newClientRect = params.rgrc[2];
    154 #if 0
    155         if(getParent()) {//in parent coordinates
    156             MapWindowPoints(getParent()->getWindowHandle(), getWindowHandle(), (POINT *)newClientRect, 2);
    157         }
    158         else {//in screen coordinates (just add window rectangle origin (already in screen coordinates))
    159             OffsetRect(newClientRect, -rectWindow.left, -rectWindow.top);
    160         }
    161 #endif
    162       }
    163       else
    164         SetRectEmpty(newClientRect);
     150        *newClientRect = params.rgrc[0];
     151        //client rectangle now in screen coordinates; convert to 'frame' coordinates
     152        OffsetRect(newClientRect, -rectWindow.left, -rectWindow.top);
    165153   }
    166154
Note: See TracChangeset for help on using the changeset viewer.