From f1a0348b4e17170a9e6406869fbbd3db8b368597 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 22 Jan 2008 20:08:56 +0100 Subject: [PATCH] winex11: Make the client rect relative to the parent window for consistency with the server side. --- dlls/winex11.drv/window.c | 1 - dlls/winex11.drv/winpos.c | 18 +++++++++--------- dlls/winex11.drv/x11drv.h | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9ed5e1f6948..3948b1a361b 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -965,7 +965,6 @@ void X11DRV_sync_window_position( Display *display, struct x11drv_win_data *data old_client_rect = data->client_rect; data->client_rect = *new_client_rect; - OffsetRect( &data->client_rect, -data->whole_rect.left, -data->whole_rect.top ); if (data->gl_drawable) update_gl_drawable(display, data, &old_client_rect); diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c index e975e5e15f4..ff9997bb6f1 100644 --- a/dlls/winex11.drv/winpos.c +++ b/dlls/winex11.drv/winpos.c @@ -96,8 +96,8 @@ void X11DRV_Expose( HWND hwnd, XEvent *xev ) if (!(data = X11DRV_get_win_data( hwnd ))) return; - rect.left = event->x; - rect.top = event->y; + rect.left = data->whole_rect.left + event->x; + rect.top = data->whole_rect.top + event->y; rect.right = rect.left + event->width; rect.bottom = rect.top + event->height; @@ -112,15 +112,15 @@ void X11DRV_Expose( HWND hwnd, XEvent *xev ) SERVER_START_REQ( update_window_zorder ) { req->window = hwnd; - req->rect.left = rect.left + data->whole_rect.left; - req->rect.top = rect.top + data->whole_rect.top; - req->rect.right = rect.right + data->whole_rect.left; - req->rect.bottom = rect.bottom + data->whole_rect.top; + req->rect.left = rect.left; + req->rect.top = rect.top; + req->rect.right = rect.right; + req->rect.bottom = rect.bottom; wine_server_call( req ); } SERVER_END_REQ; - /* make position relative to client area instead of window */ + /* make position relative to client area instead of parent */ OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top ); RedrawWindow( hwnd, &rect, 0, flags ); } @@ -191,8 +191,8 @@ static void update_wm_states( Display *display, struct x11drv_win_data *data, BO if (!data->managed) return; - if (data->client_rect.left <= 0 && data->client_rect.right >= screen_width && - data->client_rect.top <= 0 && data->client_rect.bottom >= screen_height) + if (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width && + data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height) new_state |= (1 << WM_STATE_FULLSCREEN); ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d74dd59f04f..3bff7ef2bf6 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -669,7 +669,7 @@ struct x11drv_win_data Pixmap pixmap; /* Base pixmap for if gl_drawable is a GLXPixmap */ RECT window_rect; /* USER window rectangle relative to parent */ RECT whole_rect; /* X window rectangle for the whole window relative to parent */ - RECT client_rect; /* client area relative to whole window */ + RECT client_rect; /* client area relative to parent */ XIC xic; /* X input context */ XWMHints *wm_hints; /* window manager hints */ BOOL managed; /* is window managed? */