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 )
*/
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 );
}
......
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