Ignore:
Timestamp:
Dec 5, 1999, 1:31:50 AM (26 years ago)
Author:
sandervl
Message:

Rewrote some message apis + WM_WINDOWPOSCHANGED fix

File:
1 edited

Legend:

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

    r1965 r1971  
    1 /* $Id: pmwindow.cpp,v 1.61 1999-12-04 00:04:19 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.62 1999-12-05 00:31:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    277277        break;
    278278
    279 #if 0
     279#if 1
     280    case WM_ADJUSTWINDOWPOS:
     281    {
     282      PSWP     pswp = (PSWP)mp1;
     283
     284        dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     285        goto RunDefWndProc;
     286    }
     287#else
    280288    case WM_ADJUSTWINDOWPOS:
    281289    {
     
    331339        break;
    332340    }
    333 
     341#endif
     342
     343#if 1
    334344    case WM_WINDOWPOSCHANGED:
    335345    {
     
    341351      LONG      xDelta = pswp->cx - swpOld.cx;
    342352
    343         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    344 
    345         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
     353        dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     354
     355        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;
    346356
    347357        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    355365        OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());
    356366
    357         if (!win32wnd->CanReceiveSizeMsgs())    break;
    358 
    359         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     367        if (!win32wnd->CanReceiveSizeMsgs())    goto RunDefWndProc;
     368
     369        dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
    360370        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    361371
     
    366376           wp.hwndInsertAfter = wndAfter->getWindowHandle();
    367377        }
    368 
    369         if (yDelta != 0 || xDelta != 0)
    370         {
    371             HENUM henum = WinBeginEnumWindows(pswp->hwnd);
    372             SWP swp[10];
    373             int i = 0;
    374             HWND hwnd;
    375 
    376             while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
    377             {
    378 #if 0
    379                 if (mdiClient )
    380                 {
    381                   continue;
    382                 }
    383 #endif
    384                 WinQueryWindowPos(hwnd, &(swp[i]));
    385 
    386 #ifdef DEBUG
    387                 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    388                 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
    389                          yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
    390 #endif
    391 
    392                 if(swp[i].y != 0) {
    393                     //child window at offset <> 0 from client area -> offset now changes
    394                     swp[i].y  += yDelta;
    395                     swp[i].fl &= ~(SWP_NOREDRAW);
    396                 }
    397                 //else child window with the same start coorindates as the client area
    398                 //The app should resize it.
    399 
    400                if (i == 9)
    401                 {
    402                     WinSetMultWindowPos(GetThreadHAB(), swp, 10);
    403                     i = 0;
    404                 }
    405                 else
    406                 {
    407                     i++;
    408                 }
    409             }
    410 
    411             WinEndEnumWindows(henum);
    412 
    413             if (i)
    414                WinSetMultWindowPos(GetThreadHAB(), swp, i);
    415         }
    416         if (yDelta != 0)
    417         {
    418             POINT pt;
    419             if(GetCaretPos (&pt) == TRUE)
    420             {
    421                 pt.y -= yDelta;
    422                 SetCaretPos (pt.x, pt.y);
    423             }
    424         }
     378        //SvL: Can be sent twice now (once in pmframe, once here); shouldn't really matter though...
    425379        win32wnd->MsgPosChanged((LPARAM)&wp);
    426380
     
    881835        dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
    882836#if 1
    883         break;
     837        break;
    884838#else
    885839
     
    971925//  dprintf(("OS2: RunDefWndProc msg %x for %x", msg, hwnd));
    972926  RestoreOS2TIB();
     927
    973928  return WinDefWindowProc( hwnd, msg, mp1, mp2 );
    974929} /* End of Win32WindowProc */
Note: See TracChangeset for help on using the changeset viewer.