Alexandre Julliard : winex11: Make the client rect relative to the parent window for consistency with the server side .

Alexandre Julliard julliard at winehq.org
Wed Jan 23 05:25:00 CST 2008


Module: wine
Branch: master
Commit: f1a0348b4e17170a9e6406869fbbd3db8b368597
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f1a0348b4e17170a9e6406869fbbd3db8b368597

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Jan 22 20:08:56 2008 +0100

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 9ed5e1f..3948b1a 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 e975e5e..ff9997b 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 d74dd59..3bff7ef 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? */




More information about the wine-cvs mailing list