Commit 9b693dda authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Use WIN_GetRectangles where possible instead of mapping coordinates explicitly.

parent 141defbd
...@@ -3109,8 +3109,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) ...@@ -3109,8 +3109,7 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y)
{ {
RECT rc; RECT rc;
/* Windows places the menu at the edit's center in this case */ /* Windows places the menu at the edit's center in this case */
GetClientRect(es->hwndSelf, &rc); WIN_GetRectangles( es->hwndSelf, COORDS_SCREEN, NULL, &rc );
MapWindowPoints(es->hwndSelf, 0, (POINT *)&rc, 2);
x = rc.left + (rc.right - rc.left) / 2; x = rc.left + (rc.right - rc.left) / 2;
y = rc.top + (rc.bottom - rc.top) / 2; y = rc.top + (rc.bottom - rc.top) / 2;
} }
......
...@@ -1720,13 +1720,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) ...@@ -1720,13 +1720,12 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
if (style & WS_VISIBLE) if (style & WS_VISIBLE)
{ {
RECT rect; RECT rect;
GetWindowRect( list[i], &rect ); WIN_GetRectangles( list[i], COORDS_PARENT, &rect, NULL );
UnionRect( &childRect, &rect, &childRect ); UnionRect( &childRect, &rect, &childRect );
} }
} }
HeapFree( GetProcessHeap(), 0, list ); HeapFree( GetProcessHeap(), 0, list );
} }
MapWindowPoints( 0, hwnd, (POINT *)&childRect, 2 );
UnionRect( &childRect, &clientRect, &childRect ); UnionRect( &childRect, &clientRect, &childRect );
/* set common info values */ /* set common info values */
......
...@@ -3632,8 +3632,7 @@ BOOL WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags ) ...@@ -3632,8 +3632,7 @@ BOOL WINAPI EnableMenuItem( HMENU hMenu, UINT wItemID, UINT wFlags )
return (UINT)-1; return (UINT)-1;
/* Refresh the frame to reflect the change */ /* Refresh the frame to reflect the change */
GetWindowRect(parentMenu->hWnd, &rc); WIN_GetRectangles( parentMenu->hWnd, COORDS_CLIENT, &rc, NULL );
MapWindowPoints(0, parentMenu->hWnd, (POINT *)&rc, 2);
rc.bottom = 0; rc.bottom = 0;
RedrawWindow(parentMenu->hWnd, &rc, 0, RDW_FRAME | RDW_INVALIDATE | RDW_NOCHILDREN); RedrawWindow(parentMenu->hWnd, &rc, 0, RDW_FRAME | RDW_INVALIDATE | RDW_NOCHILDREN);
} }
......
...@@ -637,8 +637,7 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags ) ...@@ -637,8 +637,7 @@ static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags )
/* check if update rgn overlaps with nonclient area */ /* check if update rgn overlaps with nonclient area */
type = GetRgnBox( whole_rgn, &update ); type = GetRgnBox( whole_rgn, &update );
GetClientRect( hwnd, &client ); WIN_GetRectangles( hwnd, COORDS_SCREEN, 0, &client );
MapWindowPoints( hwnd, 0, (POINT *)&client, 2 );
if ((*flags & UPDATE_NONCLIENT) || if ((*flags & UPDATE_NONCLIENT) ||
update.left < client.left || update.top < client.top || update.left < client.left || update.top < client.top ||
...@@ -1486,8 +1485,7 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy, ...@@ -1486,8 +1485,7 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
RECT r, dummy; RECT r, dummy;
for (i = 0; list[i]; i++) for (i = 0; list[i]; i++)
{ {
GetWindowRect( list[i], &r ); WIN_GetRectangles( list[i], COORDS_PARENT, &r, NULL );
MapWindowPoints( 0, hwnd, (POINT *)&r, 2 );
if (!rect || IntersectRect(&dummy, &r, rect)) if (!rect || IntersectRect(&dummy, &r, rect))
SetWindowPos( list[i], 0, r.left + dx, r.top + dy, 0, 0, SetWindowPos( list[i], 0, r.left + dx, r.top + dy, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
......
...@@ -3350,12 +3350,7 @@ UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR module, UINT size ) ...@@ -3350,12 +3350,7 @@ UINT WINAPI GetWindowModuleFileNameW( HWND hwnd, LPWSTR module, UINT size )
BOOL WINAPI GetWindowInfo( HWND hwnd, PWINDOWINFO pwi) BOOL WINAPI GetWindowInfo( HWND hwnd, PWINDOWINFO pwi)
{ {
if (!pwi) return FALSE; if (!pwi) return FALSE;
if (!IsWindow(hwnd)) return FALSE; if (!WIN_GetRectangles( hwnd, COORDS_SCREEN, &pwi->rcWindow, &pwi->rcClient )) return FALSE;
GetWindowRect(hwnd, &pwi->rcWindow);
GetClientRect(hwnd, &pwi->rcClient);
/* translate to screen coordinates */
MapWindowPoints(hwnd, 0, (LPPOINT)&pwi->rcClient, 2);
pwi->dwStyle = GetWindowLongW(hwnd, GWL_STYLE); pwi->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
pwi->dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE); pwi->dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
......
...@@ -2428,12 +2428,10 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) ...@@ -2428,12 +2428,10 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
/* Get min/max info */ /* Get min/max info */
WINPOS_GetMinMaxInfo( hwnd, NULL, NULL, &minTrack, &maxTrack ); WINPOS_GetMinMaxInfo( hwnd, NULL, NULL, &minTrack, &maxTrack );
GetWindowRect( hwnd, &sizingRect ); WIN_GetRectangles( hwnd, COORDS_PARENT, &sizingRect, NULL );
if (style & WS_CHILD) if (style & WS_CHILD)
{ {
parent = GetParent(hwnd); parent = GetParent(hwnd);
/* make sizing rect relative to parent */
MapWindowPoints( 0, parent, (POINT*)&sizingRect, 2 );
GetClientRect( parent, &mouseRect ); GetClientRect( parent, &mouseRect );
} }
else else
......
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