Changeset 10485 for trunk/src


Ignore:
Timestamp:
Feb 27, 2004, 3:38:03 PM (21 years ago)
Author:
sandervl
Message:

Reassert open DC transformation and y-inversion after SetWindowPos is called

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r10431 r10485  
    1 /* $Id: pmwindow.cpp,v 1.227 2004-01-30 22:10:26 bird Exp $ */
     1/* $Id: pmwindow.cpp,v 1.228 2004-02-27 14:38:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    705705        dprintf(("OS2: WM_SIZE (%d,%d) (%d,%d)", SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SHORT1FROMMP(mp1), SHORT2FROMMP(mp1)));
    706706        win32wnd->SetPMUpdateRegionChanged(TRUE);
     707
    707708        goto RunDefWndProc;
    708709    }
     
    725726        //This can result is visible distortions on the screen.
    726727        //Debugging showed that querying the visible region of a DC will cure
    727         //this problem (GPI probably recalculates the visible region).
     728        //this problem (GPI probably recalculates the visible region). (#334)
     729
    728730        int  nrdcs = 0;
    729731        HDC  hdcWindow[MAX_OPENDCS];
     
    736738            for(int i=0;i<nrdcs;i++) {
    737739                dprintf(("Recalc visible region of DC %x for window %x", hdcWindow[i], win32wnd->getWindowHandle()));
     740
    738741                hrgnRect = GreCreateRectRegion(hdcWindow[i], &rcl, 1);
    739742                GreCopyClipRegion(hdcWindow[i], hrgnRect, 0, COPYCRGN_VISRGN);
     
    741744            }
    742745        }
    743 
    744746        //Workaround END
    745747
     
    23822384//******************************************************************************
    23832385//******************************************************************************
     2386void RecalcVisibleRegion(Win32BaseWindow *win32wnd)
     2387{
     2388        //Workaround for PM/GPI bug when moving/sizing a window with open DCs
     2389        //
     2390        //Windows applictions often get a DC and keep it open for the duration
     2391        //of the application. When the DC's window is moved (full window dragging on)
     2392        //PM/GPI doesn't seem to update the DC properly/in time.
     2393        //This can result is visible distortions on the screen.
     2394
     2395        //We need to reset our DC (transformation & y-inversion) (#945)
     2396        //Debugging showed that querying the visible region of a DC will cure
     2397        //this problem (GPI probably recalculates the visible region). (#334)
     2398
     2399        int  nrdcs = 0;
     2400        HDC  hdcWindow[MAX_OPENDCS];
     2401
     2402        if(win32wnd->queryOpenDCs(hdcWindow, MAX_OPENDCS, &nrdcs))
     2403        {
     2404            for(int i=0;i<nrdcs;i++)
     2405            {
     2406                dprintf(("Recalc visible region of DC %x for window %x", hdcWindow[i], win32wnd->getWindowHandle()));
     2407
     2408                pDCData pHps = (pDCData)GpiQueryDCData (hdcWindow[i]);
     2409
     2410                if(pHps) setPageXForm (win32wnd, pHps);
     2411                else     DebugInt3();
     2412            }
     2413        }
     2414        //Workaround END
     2415}
     2416//******************************************************************************
     2417//******************************************************************************
    23842418static char *PMDragExtractFiles(PDRAGINFO pDragInfo, ULONG *pcItems, ULONG *pulBytes)
    23852419{
     
    26272661}
    26282662#endif
     2663
  • trunk/src/user32/pmwindow.h

    r10285 r10485  
    1 /* $Id: pmwindow.h,v 1.21 2003-10-22 12:43:14 sandervl Exp $ */
     1/* $Id: pmwindow.h,v 1.22 2004-02-27 14:38:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    4747VOID FrameTrackFrame(Win32BaseWindow *win32wnd,DWORD flags);
    4848void Frame_SysCommandSizeMove(Win32BaseWindow *win32wnd, WPARAM wParam);
     49void RecalcVisibleRegion(Win32BaseWindow *win32wnd);
    4950#endif
    5051
  • trunk/src/user32/win32wbase.cpp

    r10406 r10485  
    1 /* $Id: win32wbase.cpp,v 1.385 2004-01-19 12:39:02 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.386 2004-02-27 14:38:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    26622662        InvalidateRect(getWindowHandle(), NULL, TRUE);
    26632663    }
     2664
     2665    if(!(fuFlags & SWP_NOSIZE))
     2666    {
     2667        // We must call this function or open DC will get out of sync
     2668        // (PM will not always send us a WM_VRNENABLED message)
     2669        RecalcVisibleRegion(this);
     2670    }
    26642671    return (rc);
    26652672}
Note: See TracChangeset for help on using the changeset viewer.