Ignore:
Timestamp:
Mar 20, 2002, 11:30:08 AM (23 years ago)
Author:
sandervl
Message:

Changes & fixes for minimized windows

File:
1 edited

Legend:

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

    r7702 r8105  
    1 /* $Id: dc.cpp,v 1.115 2001-12-30 10:47:43 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.116 2002-03-20 10:30:06 sandervl Exp $ */
    22
    33/*
     
    660660 RECTL    rectlClient;
    661661 RECTL    rectlClip;
     662 BOOL     bIcon;
    662663
    663664    if(lpps == NULL) {
     
    675676        return (HDC)0;
    676677    }
    677     HWND hwndClient = wnd->getOS2WindowHandle();
    678 
    679     if(hwnd != HWND_DESKTOP && wnd->isOwnDC())
     678//    bIcon = (IsIconic(hwnd) && GetClassLongA(hWnd, GCL_HICON_W));
     679    bIcon = IsIconic(hwnd);
     680
     681    HWND hwndClient = (bIcon) ? wnd->getOS2FrameWindowHandle() : wnd->getOS2WindowHandle();
     682
     683    if(hwnd != HWND_DESKTOP && !bIcon && wnd->isOwnDC())
    680684    {
    681685        hPS_ownDC = wnd->getOwnDC();
     
    694698    }
    695699    if(!hpsPaint) {
    696         hpsPaint = GetDCEx(hwnd, 0, (DCX_CACHE_W|DCX_USESTYLE_W));
     700        hpsPaint = GetDCEx(hwnd, 0, (DCX_CACHE_W|DCX_USESTYLE_W | ((bIcon) ? DCX_WINDOW_W : 0)));
    697701        pHps = (pDCData)GpiQueryDCData(hpsPaint);
    698702        if (!pHps)
     
    710714        dprintf (("USER32: WARNING: WinQueryUpdateRect failed (error or no update rectangle)!!"));
    711715
     716        if(bIcon) {
     717            //WinBeginPaint messes this up for icon windows; this isn't
     718            //a good solution, but it does the job
     719            //Use the entire frame window as clip region
     720            rectl.xRight = wnd->getWindowWidth();
     721            rectl.yTop   = wnd->getWindowHeight();
     722        }
     723
    712724        HRGN hrgnClip = GpiCreateRegion(pHps->hps, 1, &rectl);
    713725        GpiSetClipRegion(pHps->hps, hrgnClip, &hrgnOldClip);
     
    717729        //save old clip region (restored for CS_OWNDC windows in EndPaint)
    718730        wnd->SetClipRegion(hrgnOldClip);
    719         lComplexity = RGN_NULL;
     731        if(bIcon) {
     732              lComplexity = RGN_RECT;
     733        }
     734        else  lComplexity = RGN_NULL;
    720735    }
    721736    else {
Note: See TracChangeset for help on using the changeset viewer.