winex11: Mirror the DC exposure region for RTL devices.

oldstable
Alexandre Julliard 2010-10-04 20:41:11 +02:00
parent d076dfa8e8
commit 84102e758f
2 changed files with 19 additions and 9 deletions

View File

@ -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
{

View File

@ -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;