Module: wine Branch: master Commit: 440484fc076d209dfd95bc63ed08fa141cee55fb URL: https://source.winehq.org/git/wine.git/?a=commit;h=440484fc076d209dfd95bc63e... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Aug 28 12:21:28 2018 +0200 user32: Switch to the window DPI awareness for MDI scrolling. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/mdi.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c index f990335..10a3882 100644 --- a/dlls/user32/mdi.c +++ b/dlls/user32/mdi.c @@ -1688,11 +1688,14 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg ) */ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) { + DPI_AWARENESS_CONTEXT context; SCROLLINFO info; RECT childRect, clientRect; HWND *list; DWORD style; + context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd )); + GetClientRect( hwnd, &clientRect ); SetRectEmpty( &childRect ); @@ -1748,6 +1751,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) } break; } + SetThreadDpiAwarenessContext( context ); } @@ -1757,10 +1761,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + DPI_AWARENESS_CONTEXT context; INT newPos = -1; INT curPos, length, minPos, maxPos, shift; RECT rect; + context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hWnd )); GetClientRect( hWnd, &rect ); switch(uMsg) @@ -1778,7 +1784,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, shift = GetSystemMetrics(SM_CXVSCROLL); break; default: - return; + goto done; } switch( wParam ) @@ -1801,7 +1807,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, break; case SB_THUMBTRACK: - return; + goto done; case SB_TOP: newPos = minPos; @@ -1811,7 +1817,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, break; case SB_ENDSCROLL: CalcChildScroll(hWnd,(uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ); - return; + goto done; } if( newPos > maxPos ) @@ -1828,6 +1834,8 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, else ScrollWindowEx(hWnd ,curPos - newPos, 0, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); +done: + SetThreadDpiAwarenessContext( context ); }