Changeset 8105 for trunk/src


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

Changes & fixes for minimized windows

Location:
trunk/src/user32
Files:
5 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 {
  • trunk/src/user32/pmwindow.cpp

    r7943 r8105  
    1 /* $Id: pmwindow.cpp,v 1.169 2002-02-18 10:14:57 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.170 2002-03-20 10:30:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    987987        }
    988988
     989        //@@PF all commands from minimized window viewer or from Ctrl-Esc
     990        //are 'pure' and should be handled only by DeFrameProc - this is weird
     991        //but without them we will not have results. Pure = plain flag of restore/minimize/maximize
     992        if((pswp->fl == SWP_MINIMIZE) || (pswp->fl & SWP_RESTORE)) {
     993          // note the purity of SWP no other SWP_FLAGS allowed
     994           goto RunDefFrameWndProc;
     995        }
     996
    989997        if(pswp->fl & SWP_NOADJUST) {
    990998            //ignore weird messages (TODO: why are they sent?)
  • trunk/src/user32/win32wbase.cpp

    r8101 r8105  
    1 /* $Id: win32wbase.cpp,v 1.317 2002-03-18 15:26:30 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.318 2002-03-20 10:30:07 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    12801280       (pUpdateRect->right >= client.left) && (pUpdateRect->right < client.right) &&
    12811281       (pUpdateRect->top  >= client.top) && (pUpdateRect->top < client.bottom) &&
    1282        (pUpdateRect->bottom >= client.top) && (pUpdateRect->bottom < client.bottom))
     1282       (pUpdateRect->bottom >= client.top) && (pUpdateRect->bottom < client.bottom)
     1283       && (!(getStyle() & WS_MINIMIZE)))
    12831284    {
    12841285        return 0;
     
    12891290
    12901291    rc = SendMessageA(getWindowHandle(),WM_NCPAINT, hrgn, 0);
     1292    //Send WM_PAINTICON here if minimized, because client window will
     1293    //not receive a (valid) WM_PAINT message
     1294    if (getStyle() & WS_MINIMIZE)
     1295    {
     1296        rc = SendMessageA(getWindowHandle(),WM_PAINTICON, 1, 0);
     1297    }
    12911298
    12921299    DeleteObject(hrgn);
     
    17881795    case WM_PRINT:
    17891796        return DefWndPrint(wParam,lParam);
     1797
     1798    case WM_SYNCPAINT:
     1799        RedrawWindow(getWindowHandle(), NULL, 0, RDW_ERASENOW | RDW_ERASE | RDW_ALLCHILDREN);
     1800        return 0;
    17901801
    17911802    case WM_PAINTICON:
     
    22772288    case SW_RESTORE:
    22782289         dprintf(("ShowWindow:restoring window"));
    2279          //Set client rectangle to 0 (contains negative values)
    2280          setClientRect(0,0,0,0);
    22812290
    22822291         swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
     
    23002309        swp |= SWP_NOACTIVATE | SWP_NOZORDER;
    23012310
    2302     SetWindowPos(HWND_TOP, newPos.left, newPos.top, newPos.right, newPos.bottom, LOWORD(swp));
     2311    dprintf(("ShowWindow : SetWindowPos now"));   
     2312    if (!(getStyle() & WS_MINIMIZE)) {
     2313         SetWindowPos(HWND_TOP, newPos.left, newPos.top, newPos.right, newPos.bottom, LOWORD(swp));
     2314    }
     2315    else OSLibWinMinimizeWindow(getOS2FrameWindowHandle());
    23032316
    23042317    if(!(swp & SWP_NOACTIVATE)) {
  • trunk/src/user32/win32wbasenonclient.cpp

    r7801 r8105  
    1 /* $Id: win32wbasenonclient.cpp,v 1.38 2002-02-05 17:59:01 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.39 2002-03-20 10:30:07 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    439439            winRect->right = winRect->left;
    440440    }
    441 
     441    else {
     442        //must return empty rectangle in parent coordinates (converted to
     443        //(0,0)(0,0) in NCCALCSIZE handler
     444        winRect->right  = winRect->left;
     445        winRect->bottom = winRect->top;
     446    }
    442447    return result;
    443448}
  • trunk/src/user32/win32wbasepos.cpp

    r8042 r8105  
    1 /* $Id: win32wbasepos.cpp,v 1.28 2002-03-07 19:41:18 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.29 2002-03-20 10:30:08 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    315315            if(getParent() == NULL) {
    316316// @@PF : for now disable windows style - it messes with WV minimize - will fix it soon
    317                  SetRect(lpRect, -32000, -32000, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
     317//                SetRect(lpRect, -32000, -32000, getWindowWidth(), getWindowHeight());
    318318//                OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(), getStyle(), getExStyle());
    319                 CloseWindow();
    320319            }
    321320            else {
Note: See TracChangeset for help on using the changeset viewer.