Fixing crash under BigSur

We get a late redraw event in the current 11.X versions, fixes #19030
This commit is contained in:
Stefan Csomor 2021-01-05 15:35:48 +01:00
parent b58ee58a7b
commit 86c1fe4c79

View File

@ -2310,6 +2310,9 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
// Restrict the update region to the shape of the window, if any, and also // Restrict the update region to the shape of the window, if any, and also
// remember the region that we need to clear later. // remember the region that we need to clear later.
wxNonOwnedWindow* const tlwParent = wxpeer->MacGetTopLevelWindow(); wxNonOwnedWindow* const tlwParent = wxpeer->MacGetTopLevelWindow();
if ( tlwParent == NULL )
return;
const bool isTopLevel = tlwParent == wxpeer; const bool isTopLevel = tlwParent == wxpeer;
wxRegion clearRgn; wxRegion clearRgn;
if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED ) if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED )