Commit 84102e75 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Mirror the DC exposure region for RTL devices.

parent d076dfa8
......@@ -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
{
......
......@@ -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;
......
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