winex11: Handle Expose events by refreshing from the window surface.

This commit is contained in:
Alexandre Julliard 2012-04-30 15:09:03 +02:00
parent 33ac850c80
commit 2eebedf38e
1 changed files with 10 additions and 6 deletions

View File

@ -791,7 +791,7 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
XExposeEvent *event = &xev->xexpose;
RECT rect;
struct x11drv_win_data *data;
int flags = RDW_INVALIDATE | RDW_ERASE;
int flags = RDW_INVALIDATE | RDW_ERASE | RDW_FRAME;
TRACE( "win %p (%lx) %d,%d %dx%d\n",
hwnd, event->window, event->x, event->y, event->width, event->height );
@ -802,15 +802,19 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
rect.top = event->y;
rect.right = event->x + event->width;
rect.bottom = event->y + event->height;
if (event->window == data->whole_window)
if (data->surface)
{
OffsetRect( &rect, data->whole_rect.left - data->client_rect.left,
data->whole_rect.top - data->client_rect.top );
flags |= RDW_FRAME;
data->surface->funcs->lock( data->surface );
add_bounds_rect( data->surface->funcs->get_bounds( data->surface ), &rect );
data->surface->funcs->unlock( data->surface );
}
if (event->window != root_window)
{
OffsetRect( &rect, data->whole_rect.left - data->client_rect.left,
data->whole_rect.top - data->client_rect.top );
if (GetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL)
mirror_rect( &data->client_rect, &rect );
@ -829,7 +833,7 @@ static void X11DRV_Expose( HWND hwnd, XEvent *xev )
}
else OffsetRect( &rect, virtual_screen_rect.left, virtual_screen_rect.top );
RedrawWindow( hwnd, &rect, 0, flags );
if (!data->surface) RedrawWindow( hwnd, &rect, 0, flags );
}