server: Mirror the rectangles for RTL windows in set_window_pos.

This commit is contained in:
Alexandre Julliard 2010-09-23 15:47:46 +02:00
parent aa7cc13154
commit bc20ff50b6
2 changed files with 28 additions and 9 deletions

View File

@ -2334,9 +2334,9 @@ enum message_type
unsigned int flags; /* SWP_* flags */
user_handle_t handle; /* handle to the window */
user_handle_t previous; /* previous window in Z order */
rectangle_t window; /* window rectangle */
rectangle_t client; /* client rectangle */
VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE */
rectangle_t window; /* window rectangle (in parent coords) */
rectangle_t client; /* client rectangle (in parent coords) */
VARARG(valid,rectangles); /* valid rectangles from WM_NCCALCSIZE (in client coords) */
@REPLY
unsigned int new_style; /* new window style */
unsigned int new_ex_style; /* new window extended style */
@ -2426,7 +2426,7 @@ enum coords_relative
user_handle_t child; /* child to repaint (or window itself) */
unsigned int flags; /* resulting update flags (see below) */
data_size_t total_size; /* total size of the resulting region */
VARARG(region,rectangles); /* list of rectangles for the region */
VARARG(region,rectangles); /* list of rectangles for the region (in screen coords) */
@END
#define UPDATE_NONCLIENT 0x01 /* get region for repainting non-client area */
#define UPDATE_ERASE 0x02 /* get region for erasing client area */

View File

@ -2073,7 +2073,7 @@ DECL_HANDLER(get_window_tree)
/* set the position and Z order of a window */
DECL_HANDLER(set_window_pos)
{
const rectangle_t *visible_rect = NULL, *valid_rects = NULL;
rectangle_t window_rect, client_rect, visible_rect;
struct window *previous = NULL;
struct window *win = get_window( req->handle );
unsigned int flags = req->flags;
@ -2117,11 +2117,30 @@ DECL_HANDLER(set_window_pos)
return;
}
if (get_req_data_size() >= sizeof(rectangle_t)) visible_rect = get_req_data();
if (get_req_data_size() >= 3 * sizeof(rectangle_t)) valid_rects = visible_rect + 1;
window_rect = visible_rect = req->window;
client_rect = req->client;
if (get_req_data_size() >= sizeof(rectangle_t))
memcpy( &visible_rect, get_req_data(), sizeof(rectangle_t) );
if (win->parent && win->parent->ex_style & WS_EX_LAYOUTRTL)
{
mirror_rect( &win->parent->client_rect, &window_rect );
mirror_rect( &win->parent->client_rect, &visible_rect );
mirror_rect( &win->parent->client_rect, &client_rect );
}
if (get_req_data_size() >= 3 * sizeof(rectangle_t))
{
rectangle_t valid_rects[2];
memcpy( valid_rects, (const rectangle_t *)get_req_data() + 1, 2 * sizeof(rectangle_t) );
if (win->ex_style & WS_EX_LAYOUTRTL)
{
mirror_rect( &win->client_rect, &valid_rects[0] );
mirror_rect( &win->client_rect, &valid_rects[1] );
}
set_window_pos( win, previous, flags, &window_rect, &client_rect, &visible_rect, valid_rects );
}
else set_window_pos( win, previous, flags, &window_rect, &client_rect, &visible_rect, NULL );
if (!visible_rect) visible_rect = &req->window;
set_window_pos( win, previous, flags, &req->window, &req->client, visible_rect, valid_rects );
reply->new_style = win->style;
reply->new_ex_style = win->ex_style;
}