Commit 377820e3 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Don't rely on the cached position for windows that have a mirrored parent.

parent 79ed8429
...@@ -709,6 +709,12 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind ...@@ -709,6 +709,12 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind
WIN_ReleasePtr( win ); WIN_ReleasePtr( win );
goto other_process; goto other_process;
} }
if (parent->flags & WIN_CHILDREN_MOVED)
{
WIN_ReleasePtr( parent );
WIN_ReleasePtr( win );
goto other_process;
}
if (parent->dwExStyle & WS_EX_LAYOUTRTL) if (parent->dwExStyle & WS_EX_LAYOUTRTL)
{ {
mirror_rect( &parent->rectClient, &window_rect ); mirror_rect( &parent->rectClient, &window_rect );
...@@ -728,6 +734,11 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind ...@@ -728,6 +734,11 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind
goto other_process; goto other_process;
} }
WIN_ReleasePtr( win ); WIN_ReleasePtr( win );
if (parent->flags & WIN_CHILDREN_MOVED)
{
WIN_ReleasePtr( parent );
goto other_process;
}
win = parent; win = parent;
OffsetRect( &window_rect, win->rectClient.left, win->rectClient.top ); OffsetRect( &window_rect, win->rectClient.left, win->rectClient.top );
OffsetRect( &client_rect, win->rectClient.left, win->rectClient.top ); OffsetRect( &client_rect, win->rectClient.left, win->rectClient.top );
......
...@@ -72,6 +72,7 @@ typedef struct tagWND ...@@ -72,6 +72,7 @@ typedef struct tagWND
#define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */ #define WIN_ISMDICLIENT 0x0008 /* Window is an MDIClient */
#define WIN_ISUNICODE 0x0010 /* Window is Unicode */ #define WIN_ISUNICODE 0x0010 /* Window is Unicode */
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */ #define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0020 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */
#define WIN_CHILDREN_MOVED 0x0040 /* children may have moved, ignore stored positions */
/* Window functions */ /* Window functions */
extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN; extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN;
......
...@@ -445,7 +445,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored ) ...@@ -445,7 +445,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
mirror_from = TRUE; mirror_from = TRUE;
offset.x += wndPtr->rectClient.right - wndPtr->rectClient.left; offset.x += wndPtr->rectClient.right - wndPtr->rectClient.left;
} }
while (wndPtr != WND_DESKTOP) for (;;)
{ {
offset.x += wndPtr->rectClient.left; offset.x += wndPtr->rectClient.left;
offset.y += wndPtr->rectClient.top; offset.y += wndPtr->rectClient.top;
...@@ -453,6 +453,12 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored ) ...@@ -453,6 +453,12 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
if (!(wndPtr = WIN_GetPtr( hwnd ))) break; if (!(wndPtr = WIN_GetPtr( hwnd ))) break;
if (wndPtr == WND_OTHER_PROCESS) goto other_process; if (wndPtr == WND_OTHER_PROCESS) goto other_process;
if (wndPtr == WND_DESKTOP) break;
if (wndPtr->flags & WIN_CHILDREN_MOVED)
{
WIN_ReleasePtr( wndPtr );
goto other_process;
}
} }
} }
} }
...@@ -469,7 +475,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored ) ...@@ -469,7 +475,7 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
mirror_to = TRUE; mirror_to = TRUE;
offset.x -= wndPtr->rectClient.right - wndPtr->rectClient.left; offset.x -= wndPtr->rectClient.right - wndPtr->rectClient.left;
} }
while (wndPtr != WND_DESKTOP) for (;;)
{ {
offset.x -= wndPtr->rectClient.left; offset.x -= wndPtr->rectClient.left;
offset.y -= wndPtr->rectClient.top; offset.y -= wndPtr->rectClient.top;
...@@ -477,6 +483,12 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored ) ...@@ -477,6 +483,12 @@ static POINT WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored )
WIN_ReleasePtr( wndPtr ); WIN_ReleasePtr( wndPtr );
if (!(wndPtr = WIN_GetPtr( hwnd ))) break; if (!(wndPtr = WIN_GetPtr( hwnd ))) break;
if (wndPtr == WND_OTHER_PROCESS) goto other_process; if (wndPtr == WND_OTHER_PROCESS) goto other_process;
if (wndPtr == WND_DESKTOP) break;
if (wndPtr->flags & WIN_CHILDREN_MOVED)
{
WIN_ReleasePtr( wndPtr );
goto other_process;
}
} }
} }
} }
...@@ -1932,6 +1944,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, ...@@ -1932,6 +1944,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
WND *win; WND *win;
BOOL ret; BOOL ret;
RECT visible_rect, old_window_rect; RECT visible_rect, old_window_rect;
int old_width;
visible_rect = *window_rect; visible_rect = *window_rect;
USER_Driver->pWindowPosChanging( hwnd, insert_after, swp_flags, USER_Driver->pWindowPosChanging( hwnd, insert_after, swp_flags,
...@@ -1941,6 +1954,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, ...@@ -1941,6 +1954,7 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
if (!(win = WIN_GetPtr( hwnd ))) return FALSE; if (!(win = WIN_GetPtr( hwnd ))) return FALSE;
if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE;
old_width = win->rectClient.right - win->rectClient.left;
SERVER_START_REQ( set_window_pos ) SERVER_START_REQ( set_window_pos )
{ {
...@@ -1974,6 +1988,9 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, ...@@ -1974,6 +1988,9 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags,
mirror_rect( &client, &win->rectWindow ); mirror_rect( &client, &win->rectWindow );
mirror_rect( &client, &win->rectClient ); mirror_rect( &client, &win->rectClient );
} }
/* if an RTL window is resized the children have moved */
if (win->dwExStyle & WS_EX_LAYOUTRTL && client_rect->right - client_rect->left != old_width)
win->flags |= WIN_CHILDREN_MOVED;
} }
} }
SERVER_END_REQ; SERVER_END_REQ;
......
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