Commit 440484fc authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Switch to the window DPI awareness for MDI scrolling.

parent a5256319
...@@ -1688,11 +1688,14 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg ) ...@@ -1688,11 +1688,14 @@ BOOL WINAPI TranslateMDISysAccel( HWND hwndClient, LPMSG msg )
*/ */
void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
{ {
DPI_AWARENESS_CONTEXT context;
SCROLLINFO info; SCROLLINFO info;
RECT childRect, clientRect; RECT childRect, clientRect;
HWND *list; HWND *list;
DWORD style; DWORD style;
context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd ));
GetClientRect( hwnd, &clientRect ); GetClientRect( hwnd, &clientRect );
SetRectEmpty( &childRect ); SetRectEmpty( &childRect );
...@@ -1748,6 +1751,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) ...@@ -1748,6 +1751,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
} }
break; break;
} }
SetThreadDpiAwarenessContext( context );
} }
...@@ -1757,10 +1761,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) ...@@ -1757,10 +1761,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
DPI_AWARENESS_CONTEXT context;
INT newPos = -1; INT newPos = -1;
INT curPos, length, minPos, maxPos, shift; INT curPos, length, minPos, maxPos, shift;
RECT rect; RECT rect;
context = SetThreadDpiAwarenessContext( GetWindowDpiAwarenessContext( hWnd ));
GetClientRect( hWnd, &rect ); GetClientRect( hWnd, &rect );
switch(uMsg) switch(uMsg)
...@@ -1778,7 +1784,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, ...@@ -1778,7 +1784,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
shift = GetSystemMetrics(SM_CXVSCROLL); shift = GetSystemMetrics(SM_CXVSCROLL);
break; break;
default: default:
return; goto done;
} }
switch( wParam ) switch( wParam )
...@@ -1801,7 +1807,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, ...@@ -1801,7 +1807,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
break; break;
case SB_THUMBTRACK: case SB_THUMBTRACK:
return; goto done;
case SB_TOP: case SB_TOP:
newPos = minPos; newPos = minPos;
...@@ -1811,7 +1817,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, ...@@ -1811,7 +1817,7 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
break; break;
case SB_ENDSCROLL: case SB_ENDSCROLL:
CalcChildScroll(hWnd,(uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ); CalcChildScroll(hWnd,(uMsg == WM_VSCROLL)?SB_VERT:SB_HORZ);
return; goto done;
} }
if( newPos > maxPos ) if( newPos > maxPos )
...@@ -1828,6 +1834,8 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, ...@@ -1828,6 +1834,8 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
else else
ScrollWindowEx(hWnd ,curPos - newPos, 0, NULL, NULL, 0, NULL, ScrollWindowEx(hWnd ,curPos - newPos, 0, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
done:
SetThreadDpiAwarenessContext( context );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment