Alexandre Julliard : winex11: Mirror the DC exposure region for RTL devices .

Alexandre Julliard julliard at winehq.org
Tue Oct 5 12:03:05 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct  4 20:41:11 2010 +0200

winex11: Mirror the DC exposure region for RTL devices.

---

 dlls/winex11.drv/init.c   |   20 +++++++++++---------
 dlls/winex11.drv/x11drv.h |    8 ++++++++
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
index 1462b5e..7df6fe2 100644
--- a/dlls/winex11.drv/init.c
+++ b/dlls/winex11.drv/init.c
@@ -388,18 +388,20 @@ INT CDECL X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, L
                             if (event.type == NoExpose) break;
                             if (event.type == GraphicsExpose)
                             {
-                                int x = event.xgraphicsexpose.x - physDev->dc_rect.left;
-                                int y = event.xgraphicsexpose.y - physDev->dc_rect.top;
+                                RECT rect;
 
-                                TRACE( "got %d,%d %dx%d count %d\n", x, y,
-                                       event.xgraphicsexpose.width,
-                                       event.xgraphicsexpose.height,
+                                rect.left   = event.xgraphicsexpose.x - physDev->dc_rect.left;
+                                rect.top    = event.xgraphicsexpose.y - physDev->dc_rect.top;
+                                rect.right  = rect.left + event.xgraphicsexpose.width;
+                                rect.bottom = rect.top + event.xgraphicsexpose.height;
+                                if (GetLayout( physDev->hdc ) & LAYOUT_RTL)
+                                    mirror_rect( &physDev->dc_rect, &rect );
+
+                                TRACE( "got %s count %d\n", wine_dbgstr_rect(&rect),
                                        event.xgraphicsexpose.count );
 
-                                if (!tmp) tmp = CreateRectRgn( 0, 0, 0, 0 );
-                                SetRectRgn( tmp, x, y,
-                                            x + event.xgraphicsexpose.width,
-                                            y + event.xgraphicsexpose.height );
+                                if (!tmp) tmp = CreateRectRgnIndirect( &rect );
+                                else SetRectRgn( tmp, rect.left, rect.top, rect.right, rect.bottom );
                                 if (hrgn) CombineRgn( hrgn, hrgn, tmp, RGN_OR );
                                 else
                                 {
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 3590d44..a4b9d76 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -777,6 +777,14 @@ extern void update_user_time( Time time );
 extern void update_net_wm_states( Display *display, struct x11drv_win_data *data );
 extern void make_window_embedded( Display *display, struct x11drv_win_data *data );
 
+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;
+}
+
 /* X context to associate a hwnd to an X window */
 extern XContext winContext;
 




More information about the wine-cvs mailing list