diff options
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salframe.h | 4 | ||||
-rw-r--r-- | vcl/win/app/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 17 |
4 files changed, 8 insertions, 17 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 45c402363119..8f5a3b87b415 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -215,7 +215,7 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); // wParam == 0; lParam == pObject; #define SAL_MSG_DESTROYOBJECT (WM_USER+117) // wParam == hWnd; lParam == 0; lResult == hDC -#define SAL_MSG_GETDC (WM_USER+120) +#define SAL_MSG_GETCACHEDDC (WM_USER+120) // wParam == hWnd; lParam == 0 #define SAL_MSG_RELEASEDC (WM_USER+121) // wParam == newParentHwnd; lParam == oldHwnd; lResult == newhWnd diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index 77902a40034e..36e4a041c955 100644 --- a/vcl/inc/win/salframe.h +++ b/vcl/inc/win/salframe.h @@ -33,8 +33,8 @@ public: HWND mhWnd; // Window handle HCURSOR mhCursor; // cursor handle HIMC mhDefIMEContext; // default IME-Context - WinSalGraphics* mpLocalGraphics; // current local frame graphics - WinSalGraphics* mpThreadGraphics; // current frame graphics for other threads + WinSalGraphics* mpLocalGraphics; // current main thread frame graphics + WinSalGraphics* mpThreadGraphics; // current frame graphics for other threads (DCX_CACHE) WinSalFrame* mpNextFrame; // pointer to next frame HMENU mSelectedhMenu; // the menu where highlighting is currently going on HMENU mLastActivatedhMenu; // the menu that was most recently opened diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 5671361c987b..b13360f40b16 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -639,7 +639,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, b CASE_NOYIELDLOCK_RESULT( SAL_MSG_CREATEOBJECT, ImplSalCreateObject( GetSalData()->mpInstance, reinterpret_cast<WinSalFrame*>(lParam)) ) CASE_NOYIELDLOCK( SAL_MSG_DESTROYOBJECT, delete reinterpret_cast<SalObject*>(lParam) ) - CASE_NOYIELDLOCK_RESULT( SAL_MSG_GETDC, GetDCEx( + CASE_NOYIELDLOCK_RESULT( SAL_MSG_GETCACHEDDC, GetDCEx( reinterpret_cast<HWND>(wParam), nullptr, DCX_CACHE) ) CASE_NOYIELDLOCK( SAL_MSG_RELEASEDC, ReleaseDC( reinterpret_cast<HWND>(wParam), reinterpret_cast<HDC>(lParam)) ) diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index dd0c4a521f74..f34c9d0936cc 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -924,17 +924,12 @@ bool WinSalFrame::ReleaseFrameGraphicsDC( WinSalGraphics* pGraphics ) // we don't want to run the WinProc in the main thread directly // so we don't hit the mbNoYieldLock assert if ( !pSalData->mpInstance->IsMainThread() ) - { - assert( pGraphics == mpThreadGraphics ); SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, reinterpret_cast<WPARAM>(mhWnd), reinterpret_cast<LPARAM>(hDC) ); - pSalData->mnCacheDCInUse--; - } else - { - assert( pGraphics == mpLocalGraphics ); ReleaseDC( mhWnd, hDC ); - } + if ( pGraphics == mpThreadGraphics ) + pSalData->mnCacheDCInUse--; pGraphics->setHDC(nullptr); return TRUE; } @@ -998,10 +993,6 @@ bool WinSalFrame::InitFrameGraphicsDC( WinSalGraphics *pGraphics, HDC hDC, HWND { SalData* pSalData = GetSalData(); assert( pGraphics ); - if ( !pSalData->mpInstance->IsMainThread() ) - assert( pGraphics == mpThreadGraphics ); - else - assert( pGraphics == mpLocalGraphics ); pGraphics->setHWND( hWnd ); HDC hCurrentDC = pGraphics->getHDC(); @@ -1049,7 +1040,7 @@ SalGraphics* WinSalFrame::AcquireGraphics() pGraphics = mpThreadGraphics; assert( !pGraphics->getHDC() ); hDC = reinterpret_cast<HDC>(static_cast<sal_IntPtr>(SendMessageW( pSalData->mpInstance->mhComWnd, - SAL_MSG_GETDC, reinterpret_cast<WPARAM>(mhWnd), 0 ))); + SAL_MSG_GETCACHEDDC, reinterpret_cast<WPARAM>(mhWnd), 0 ))); } else { @@ -1529,7 +1520,7 @@ void WinSalFrame::ImplSetParentFrame( HWND hNewParentWnd, bool bAsChild ) { HDC hDC = reinterpret_cast<HDC>(static_cast<sal_IntPtr>( SendMessageW( pSalData->mpInstance->mhComWnd, - SAL_MSG_GETDC, reinterpret_cast<WPARAM>(hWnd), 0 ))); + SAL_MSG_GETCACHEDDC, reinterpret_cast<WPARAM>(hWnd), 0 ))); InitFrameGraphicsDC( mpThreadGraphics, hDC, hWnd ); if ( hDC ) { |