server: Expose areas revealed by changes to the window region.

This commit is contained in:
Alexandre Julliard 2007-03-05 16:43:09 +01:00
parent 366dbd2f81
commit 1767b4558a
5 changed files with 34 additions and 3 deletions

View File

@ -250,6 +250,7 @@ int WINAPI SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL bRedraw )
SERVER_START_REQ( set_window_region ) SERVER_START_REQ( set_window_region )
{ {
req->window = hwnd; req->window = hwnd;
req->redraw = (bRedraw != 0);
if (data->rdh.nCount) if (data->rdh.nCount)
wine_server_add_data( req, data->Buffer, data->rdh.nCount * sizeof(RECT) ); wine_server_add_data( req, data->Buffer, data->rdh.nCount * sizeof(RECT) );
else else
@ -263,6 +264,7 @@ int WINAPI SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL bRedraw )
SERVER_START_REQ( set_window_region ) SERVER_START_REQ( set_window_region )
{ {
req->window = hwnd; req->window = hwnd;
req->redraw = (bRedraw != 0);
ret = !wine_server_call_err( req ); ret = !wine_server_call_err( req );
} }
SERVER_END_REQ; SERVER_END_REQ;

View File

@ -3060,6 +3060,7 @@ struct set_window_region_request
{ {
struct request_header __header; struct request_header __header;
user_handle_t window; user_handle_t window;
int redraw;
/* VARARG(region,rectangles); */ /* VARARG(region,rectangles); */
}; };
struct set_window_region_reply struct set_window_region_reply
@ -4671,6 +4672,6 @@ union generic_reply
struct get_token_impersonation_level_reply get_token_impersonation_level_reply; struct get_token_impersonation_level_reply get_token_impersonation_level_reply;
}; };
#define SERVER_PROTOCOL_VERSION 278 #define SERVER_PROTOCOL_VERSION 279
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -2233,6 +2233,7 @@ enum message_type
/* Set the window region */ /* Set the window region */
@REQ(set_window_region) @REQ(set_window_region)
user_handle_t window; /* handle to the window */ user_handle_t window; /* handle to the window */
int redraw; /* redraw the window? */
VARARG(region,rectangles); /* list of rectangles for the region */ VARARG(region,rectangles); /* list of rectangles for the region */
@END @END

View File

@ -2708,6 +2708,7 @@ static void dump_get_window_region_reply( const struct get_window_region_reply *
static void dump_set_window_region_request( const struct set_window_region_request *req ) static void dump_set_window_region_request( const struct set_window_region_request *req )
{ {
fprintf( stderr, " window=%p,", req->window ); fprintf( stderr, " window=%p,", req->window );
fprintf( stderr, " redraw=%d,", req->redraw );
fprintf( stderr, " region=" ); fprintf( stderr, " region=" );
dump_varargs_rectangles( cur_size ); dump_varargs_rectangles( cur_size );
} }

View File

@ -1443,6 +1443,33 @@ done:
} }
/* set the window region, updating the update region if necessary */
static void set_window_region( struct window *win, struct region *region, int redraw )
{
struct region *old_vis_rgn = NULL, *new_vis_rgn;
struct window *top = get_top_clipping_window( win );
/* no need to redraw if window is not visible */
if (redraw && !is_visible( win )) redraw = 0;
if (redraw) old_vis_rgn = get_visible_region( win, top, DCX_WINDOW );
if (win->win_region) free_region( win->win_region );
win->win_region = region;
if (old_vis_rgn && (new_vis_rgn = get_visible_region( win, top, DCX_WINDOW )))
{
/* expose anything revealed by the change */
if (xor_region( new_vis_rgn, old_vis_rgn, new_vis_rgn ))
expose_window( win, top, new_vis_rgn );
free_region( new_vis_rgn );
}
if (old_vis_rgn) free_region( old_vis_rgn );
clear_error(); /* we ignore out of memory errors since the region has been set */
}
/* create a window */ /* create a window */
DECL_HANDLER(create_window) DECL_HANDLER(create_window)
{ {
@ -1900,8 +1927,7 @@ DECL_HANDLER(set_window_region)
if (!(region = create_region_from_req_data( get_req_data(), get_req_data_size() ))) if (!(region = create_region_from_req_data( get_req_data(), get_req_data_size() )))
return; return;
} }
if (win->win_region) free_region( win->win_region ); set_window_region( win, region, req->redraw );
win->win_region = region;
} }