Changeset 3341 for trunk/src


Ignore:
Timestamp:
Apr 7, 2000, 2:55:16 PM (25 years ago)
Author:
sandervl
Message:

clip fix for WM_NCPAINT

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r3297 r3341  
    1 /* $Id: dc.cpp,v 1.53 2000-04-02 09:27:22 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.54 2000-04-07 12:55:15 sandervl Exp $ */
    22
    33/*
     
    936936      else //DCX_INTERSECTRGN_W
    937937      {
     938         //SvL: I'm getting paint problems when clipping a dc created in GetDCEx
     939         //     with a region that covers the entire window (RealPlayer 7 Update 1)
     940         //     Using SelectClipRgn here doesn't make any difference.
    938941         if(ExtSelectClipRgn(pHps->hps, hrgn, RGN_AND_W) == ERROR_W) {
    939942                dprintf(("ExtSelectClipRgn failed!!"));
  • trunk/src/user32/win32wbase.cpp

    r3284 r3341  
    1 /* $Id: win32wbase.cpp,v 1.176 2000-03-31 14:42:48 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.177 2000-04-07 12:55:16 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10261026
    10271027////    mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client);
    1028     if ((rect.left >= client.left) && (rect.left < client.right) &&
    1029         (rect.right >= client.left) && (rect.right < client.right) &&
    1030         (rect.top  >= client.top) && (rect.top < client.bottom) &&
    1031         (rect.bottom >= client.top) && (rect.bottom < client.bottom))
    1032       return 0;
    1033 
    1034     dprintf(("MsgNCPaint (%d,%d)(%d,%d)", rect.left, rect.top, rect.right, rect.bottom));
    1035     hrgn = CreateRectRgnIndirect(&rect);
    1036     if (!hrgn) return 0;
    1037     rc = SendInternalMessageA(WM_NCPAINT,hrgn,0);
    1038     DeleteObject(hrgn);
    1039 
    1040     return rc;
    1041   }
    1042   else return 0;
     1028        if ((rect.left >= client.left) && (rect.left < client.right) &&
     1029           (rect.right >= client.left) && (rect.right < client.right) &&
     1030           (rect.top  >= client.top) && (rect.top < client.bottom) &&
     1031           (rect.bottom >= client.top) && (rect.bottom < client.bottom))
     1032        {
     1033                return 0;
     1034        }
     1035
     1036        dprintf(("MsgNCPaint (%d,%d)(%d,%d)", rect.left, rect.top, rect.right, rect.bottom));
     1037        hrgn = CreateRectRgnIndirect(&rect);
     1038        if (!hrgn) return 0;
     1039
     1040        rc = SendInternalMessageA(WM_NCPAINT,hrgn,0);
     1041
     1042        DeleteObject(hrgn);
     1043
     1044        return rc;
     1045  }
     1046  else  return 0;
    10431047}
    10441048//******************************************************************************
     
    12951299        if ((dwStyle & WS_CAPTION) == WS_CAPTION)
    12961300        {
    1297           HandleNCPaint((HRGN)1);
     1301//          HandleNCPaint((HRGN)1);
    12981302          OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
    12991303        }
  • trunk/src/user32/win32wbasenonclient.cpp

    r3337 r3341  
    1 /* $Id: win32wbasenonclient.cpp,v 1.20 2000-04-07 10:01:18 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.21 2000-04-07 12:55:16 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    972972    DrawTextExA(memDC,buffer,-1,&r,DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT | DT_END_ELLIPSIS,NULL);
    973973    DeleteObject (SelectObject (memDC, hOldFont));
     974    IncreaseLogCount();
     975    dprintf(("DrawCaption %s %d", buffer, active));
     976    DecreaseLogCount();
    974977  }
    975978
     
    9971000  DecreaseLogCount();
    9981001
     1002  rect.top    = rect.left = 0;
     1003  rect.right  = rectWindow.right - rectWindow.left;
     1004  rect.bottom = rectWindow.bottom - rectWindow.top;
     1005
     1006  if (clip > 1)
     1007  {
     1008    //only redraw caption
     1009    GetRgnBox(clip,&rectClip);
     1010    //SvL: I'm getting paint problems when clipping a dc created in GetDCEx
     1011    //     with a region that covers the entire window (RealPlayer 7 Update 1)
     1012    //     As we don't need to clip anything when that occurs, this workaround
     1013    //     solves the problem.
     1014    if(rectClip.right == getWindowWidth() && rectClip.bottom == getWindowHeight())
     1015    {
     1016        clip = 0;
     1017        rectClip = rect;
     1018    }
     1019  }
     1020  else
     1021  {
     1022    clip = 0;
     1023    rectClip = rect;
     1024  }
     1025
    9991026  if (!(hdc = GetDCEx( Win32Hwnd, (clip > 1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW |
    10001027                      ((clip > 1) ?(DCX_INTERSECTRGN /*| DCX_KEEPCLIPRGN*/) : 0) ))) return;
    1001 
    1002   rect.top = rect.left = 0;
    1003   rect.right  = rectWindow.right - rectWindow.left;
    1004   rect.bottom = rectWindow.bottom - rectWindow.top;
    1005 
    1006   if (clip > 1)
    1007   {
    1008     //only redraw caption
    1009     GetRgnBox(clip,&rectClip);
    1010   }
    1011   else
    1012   {
    1013     clip = 0;
    1014     rectClip = rect;
    1015   }
    10161028
    10171029  SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
     
    10441056      rect.top += GetSystemMetrics(SM_CYCAPTION);
    10451057    }
    1046     if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) )
     1058    if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) 
    10471059      DrawCaption(hdc,&r,active);
    10481060  }
Note: See TracChangeset for help on using the changeset viewer.