fixing a CG error during construction on 10.6, resizing the client area so that the content doesn't extend over the shape's boundingbox at the right and the bottom
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@67125 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1809,13 +1809,19 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
||||
|
||||
static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect)
|
||||
{
|
||||
#if 1
|
||||
// under 10.6 we are getting errors during construction otherwise
|
||||
::GetWindowBounds(window, kWindowGlobalPortRgn, inRect);
|
||||
#else
|
||||
GetWindowPortBounds(window, inRect);
|
||||
|
||||
Point pt = { inRect->top ,inRect->left };
|
||||
wxMacLocalToGlobal( window, &pt ) ;
|
||||
inRect->bottom += pt.v - inRect->top;
|
||||
inRect->right += pt.h - inRect->left;
|
||||
inRect->top = pt.v;
|
||||
inRect->left = pt.h;
|
||||
#endif
|
||||
}
|
||||
|
||||
static SInt32 wxShapedMacWindowGetFeatures(WindowRef window, SInt32 param)
|
||||
@@ -1849,10 +1855,27 @@ static void wxShapedMacWindowContentRegion(WindowRef window, RgnHandle rgn)
|
||||
wxTopLevelWindowMac* win = wxFindWinFromMacWindow(window);
|
||||
if (win)
|
||||
{
|
||||
Rect r ;
|
||||
wxShapedMacWindowGetPos( window, &r ) ;
|
||||
Rect windowRect ;
|
||||
wxShapedMacWindowGetPos( window, &windowRect ) ;
|
||||
#if 1
|
||||
// the port rectangle of the window may be larger than the window was set,
|
||||
// therefore we clip at the right and bottom of the shape
|
||||
RgnHandle cachedRegion = (RgnHandle) GetWRefCon(window);
|
||||
|
||||
if (cachedRegion)
|
||||
{
|
||||
CopyRgn(cachedRegion, rgn); // make a copy of our cached region
|
||||
OffsetRgn(rgn, windowRect.left, windowRect.top); // position it over window
|
||||
Rect r;
|
||||
GetRegionBounds(rgn,&r);
|
||||
r.left = windowRect.left;
|
||||
r.top = windowRect.top;
|
||||
RectRgn( rgn , &r ) ;
|
||||
}
|
||||
#else
|
||||
RectRgn( rgn , &windowRect ) ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// The structure region is set to the shape given to the SetShape method.
|
||||
|
Reference in New Issue
Block a user