Ignore:
Timestamp:
Jul 17, 1999, 8:30:52 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

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

    r323 r324  
    1 /* $Id: pmwindow.cpp,v 1.6 1999-07-17 15:23:38 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.7 1999-07-17 18:30:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    164164    case WM_MOVE:
    165165    {
    166      RECTL  rectl, rectl2;
    167      POINTL point;
    168      HWND   hwndParent;
    169      ULONG  xScreen, yScreen, yParent, xParent;
     166      RECTL rectChild;
     167      ULONG xParent, yParent;
    170168
    171169        dprintf(("OS2: WM_MOVE %x", hwnd));
    172         rc = WinQueryWindowRect(hwnd, &rectl);
    173         if(rc == TRUE) {
    174                 point.x = rectl.xLeft;
    175                 point.y = rectl.yBottom;
    176 
    177                 //If the window has a parent, calculate position relative to that window
    178                 if((hwndParent = WinQueryWindow(hwnd, QW_PARENT)) != WinQueryDesktopWindow(hab, NULLHANDLE)) {
    179                         rc = WinMapWindowPoints(hwnd, hwndParent, &point, 1);
    180                         if(rc == FALSE) {
    181                                 dprintf(("WM_MOVE: WinMapWindowPoints (parent) failed!"));
    182                                 break;
    183                         }
    184                         rc = WinQueryWindowRect(hwndParent, &rectl2);
    185                         if(rc == FALSE) {
    186                                 dprintf(("WM_MOVE: WinQueryWindowRect(HWND_DESKTOP, &rectl) failed!"));
    187                                 break;
    188                         }
    189                         xParent = point.x;
    190                         yParent = OS2TOWIN32POINT(rectl2.yTop - rectl2.yBottom, point.y);
    191                 }
    192                 else    xParent = yParent = -1;
    193 
    194                 point.x = rectl.xLeft;
    195                 point.y = rectl.yBottom;
    196 
    197                 rc = WinMapWindowPoints(hwnd, HWND_DESKTOP, &point, 1);
    198                 if(rc == FALSE) {
    199                         dprintf(("WM_MOVE: WinMapWindowPoints (desktop) failed!"));
    200                         break;
    201                 }
    202                 rc = WinQueryWindowRect(HWND_DESKTOP, &rectl);
    203                 if(rc == FALSE) {
    204                         dprintf(("WM_MOVE: WinQueryWindowRect(HWND_DESKTOP, &rectl) failed!"));
    205                         break;
    206                 }
    207                 xScreen = point.x;
    208                 yScreen = OS2TOWIN32POINT(rectl.yTop - rectl.yBottom, point.y);
    209 
    210                 if(win32wnd->MsgMove(xScreen, yScreen, xParent, yParent)) {
    211                         goto RunDefWndProc;
    212                 }
    213         }
    214         else {
    215                 dprintf(("WM_MOVE: WinQueryWindowRect failed!"));
     170
     171        WinQueryWindowRect(hwnd, &rectChild);
     172
     173        //Calculate position relative to parent window (real window or desktop)
     174        xParent = rectChild.xLeft;
     175        yParent = MapOS2ToWin32Y(hwnd, &rectChild, rectChild.yBottom);
     176
     177        if(win32wnd->MsgMove(xParent, yParent)) {
     178                goto RunDefWndProc;
    216179        }
    217180        break;
     
    266229                goto RunDefWndProc;
    267230        }
    268 
    269231        break;
    270232    }
Note: See TracChangeset for help on using the changeset viewer.