From 26c1972f276127296ec50bebc1e12e2a6b5f4af7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 6 Jan 2009 17:36:29 +0000 Subject: [PATCH] Workaround for _SetDstBlits32BGRA crash when compiling and running on Leopard (happens in complex app but not in AUI sample) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@57862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/framemanager.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 5be7f876ff..978b097d13 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -4014,7 +4014,16 @@ void wxAuiManager::OnLeftUp(wxMouseEvent& event) m_frame->ReleaseMouse(); // get rid of the hint rectangle + + // On Mac we use a wxClientDC since when compiling and running on Leopard, + // we can get the dreaded _SetDstBlits32BGRA crash (but not in the AUI sample). + // This only helps in non-CG mode - there is zero resize feeedback in CG mode + // at present. +#ifdef __WXMAC__ + wxClientDC dc(m_frame); +#else wxScreenDC dc; +#endif DrawResizeHint(dc, m_action_hintrect); // resize the dock or the pane @@ -4286,10 +4295,20 @@ void wxAuiManager::OnMotion(wxMouseEvent& event) else pos.x = wxMax(0, event.m_x - m_action_offset.x); - wxRect rect(m_frame->ClientToScreen(pos), - m_action_part->rect.GetSize()); + // On Mac we use a wxClientDC since when compiling and running on Leopard, + // we can get the dreaded _SetDstBlits32BGRA crash (but not in the AUI sample). + // This only helps in non-CG mode - there is zero resize feeedback in CG mode + // at present. +#ifdef __WXMAC__ + wxRect rect(pos, + m_action_part->rect.GetSize()); + wxClientDC dc(m_frame); +#else + wxRect rect(m_frame->ClientToScreen(pos), + m_action_part->rect.GetSize()); wxScreenDC dc; +#endif if (!m_action_hintrect.IsEmpty()) DrawResizeHint(dc, m_action_hintrect); DrawResizeHint(dc, rect);