Changeset 6166 for trunk/src


Ignore:
Timestamp:
Jul 4, 2001, 11:29:52 AM (24 years ago)
Author:
sandervl
Message:

SetParent bugfix

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r6040 r6166  
    1 /* $Id: pmwindow.cpp,v 1.137 2001-06-17 21:08:00 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.138 2001-07-04 09:29:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    494494
    495495    case WM_TIMER:
     496        dprintf(("WM_TIMER %x %x time %x", win32wnd->getWindowHandle(), pWinMsg->wParam, GetTickCount()));
    496497        win32wnd->DispatchMsgA(pWinMsg);
    497498        goto RunDefWndProc;
     
    751752        dprintf(("PMFRAME:WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    752753
     754        if(win32wnd->IsParentChanging()) {
     755            rc = 0;
     756            break;
     757        }
     758
    753759        if(pswp->fl & SWP_NOADJUST) {
    754760            //ignore weird messages (TODO: why are they sent?)
     
    877883
    878884        dprintf(("PMFRAME:WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     885        if(win32wnd->IsParentChanging()) {
     886            goto PosChangedEnd;
     887        }
    879888
    880889        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
  • trunk/src/user32/win32wbase.cpp

    r6040 r6166  
    1 /* $Id: win32wbase.cpp,v 1.271 2001-06-17 21:08:01 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.272 2001-07-04 09:29:51 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    106106  fInternalMsg     = FALSE;
    107107  fNoSizeMsg       = FALSE;
     108  fParentChange    = FALSE;
    108109  fIsDestroyed     = FALSE;
    109110  fDestroyWindowCalled = FALSE;
     
    27872788   }
    27882789   if(oldparent) {
     2790        //release parent here (increased refcount during creation)
    27892791        RELEASE_WNDOBJ(oldparent);
    27902792   }
     
    27942796        setParent(newparent);
    27952797        getParent()->addChild(this);
     2798        fParentChange = TRUE;
     2799
    27962800        OSLibWinSetParent(getOS2FrameWindowHandle(), getParent()->getOS2WindowHandle());
    27972801        if(!(getStyle() & WS_CHILD))
     
    28052809            }
    28062810        }
     2811        //SvL: Even though the win32 coordinates might not change, the PM
     2812        //     coordinates can. We must make sure the control stays at the
     2813        //     same position (y) relative to the (new) parent.
     2814        SetWindowPos(HWND_TOPMOST, rectWindow.left, rectWindow.top, 0, 0,
     2815                     SWP_NOACTIVATE|SWP_NOSIZE);
     2816        fParentChange = FALSE;
    28072817   }
    28082818   else {
  • trunk/src/user32/win32wbase.h

    r6067 r6166  
    1 /* $Id: win32wbase.h,v 1.121 2001-06-22 18:32:11 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.122 2001-07-04 09:29:52 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    253253         HWND   getOS2HwndModalDialog()       { return OS2HwndModalDialog; };
    254254         BOOL   CanReceiveSizeMsgs()          { return !fNoSizeMsg; };
     255         BOOL   IsParentChanging()            { return fParentChange; };
    255256         BOOL   IsWindowCreated()             { return fCreated; }
    256257         BOOL   IsWindowDestroyed()           { return fIsDestroyed; };
     
    373374                                         //sent by PM and those sent by apps
    374375                 fNoSizeMsg:1,
     376                 fParentChange:1,
    375377                 fIsDestroyed:1,
    376378                 fDestroyWindowCalled:1, //DestroyWindow was called for this window
Note: See TracChangeset for help on using the changeset viewer.