From 024521190a530b2c952e459b241168d51ab152c3 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 23 Sep 2010 15:48:02 +0200 Subject: [PATCH] user32: Always store the window rectangles unmirrored after SetWindowPos. --- dlls/user32/win.c | 8 -------- dlls/user32/win.h | 8 ++++++++ dlls/user32/winpos.c | 7 +++++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 17925e9f1e..b847a44c8e 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -44,14 +44,6 @@ static DWORD process_layout; /**********************************************************************/ -static inline void mirror_rect( const RECT *window_rect, RECT *rect ) -{ - int width = window_rect->right - window_rect->left; - int tmp = rect->left; - rect->left = width - rect->right; - rect->right = width - tmp; -} - /* helper for Get/SetWindowLong */ static inline LONG_PTR get_win_data( const void *ptr, UINT size ) { diff --git a/dlls/user32/win.h b/dlls/user32/win.h index 631cc9649d..2d5ff872bf 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -120,4 +120,12 @@ extern BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ) DECLSPEC_HIDDEN; +static inline void mirror_rect( const RECT *window_rect, RECT *rect ) +{ + int width = window_rect->right - window_rect->left; + int tmp = rect->left; + rect->left = width - rect->right; + rect->right = width - tmp; +} + #endif /* __WINE_WIN_H */ diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index d746e19377..fbcd432002 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1931,6 +1931,13 @@ BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, win->dwExStyle = reply->new_ex_style; win->rectWindow = *window_rect; win->rectClient = *client_rect; + if (GetWindowLongW( win->parent, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) + { + RECT client; + GetClientRect( win->parent, &client ); + mirror_rect( &client, &win->rectWindow ); + mirror_rect( &client, &win->rectClient ); + } } } SERVER_END_REQ;