Alexandre Julliard : user32: Always store the window rectangles unmirrored after SetWindowPos.

Alexandre Julliard julliard at winehq.org
Thu Sep 23 12:43:49 CDT 2010


Module: wine
Branch: master
Commit: 024521190a530b2c952e459b241168d51ab152c3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=024521190a530b2c952e459b241168d51ab152c3

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Sep 23 15:48:02 2010 +0200

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 17925e9..b847a44 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 631cc96..2d5ff87 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 d746e19..fbcd432 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;




More information about the wine-cvs mailing list