Alexandre Julliard : winex11: When re-creating a client window check the new visual against the current one instead of the default one .

Alexandre Julliard julliard at winehq.org
Tue May 13 04:39:49 CDT 2008


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue May 13 10:43:48 2008 +0200

winex11: When re-creating a client window check the new visual against the current one instead of the default one.

---

 dlls/winex11.drv/window.c |    6 ++++--
 dlls/winex11.drv/x11drv.h |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 191931a..674afaa 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -257,6 +257,7 @@ static Window create_client_window( Display *display, struct x11drv_win_data *da
     int cx, cy, mask;
     XSetWindowAttributes attr;
     Window client;
+    Visual *client_visual = vis ? vis->visual : visual;
 
     attr.bit_gravity = NorthWestGravity;
     attr.win_gravity = NorthWestGravity;
@@ -282,7 +283,7 @@ static Window create_client_window( Display *display, struct x11drv_win_data *da
                             data->client_rect.left - data->whole_rect.left,
                             data->client_rect.top - data->whole_rect.top,
                             cx, cy, 0, screen_depth, InputOutput,
-                            vis ? vis->visual : visual, mask, &attr );
+                            client_visual, mask, &attr );
     if (!client)
     {
         wine_tsx11_unlock();
@@ -297,6 +298,7 @@ static Window create_client_window( Display *display, struct x11drv_win_data *da
         XDestroyWindow( display, data->client_window );
     }
     data->client_window = client;
+    data->visualid = XVisualIDFromVisual( client_visual );
 
     if (data->colormap) XFreeColormap( display, data->colormap );
     data->colormap = vis ? attr.colormap : 0;
@@ -431,7 +433,7 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
         Display *display = thread_display();
         Window client = data->client_window;
 
-        if (vis->visualid != XVisualIDFromVisual(visual))
+        if (vis->visualid != data->visualid)
         {
             client = create_client_window( display, data, vis );
             TRACE( "re-created client window %lx for %p fbconfig %lx\n", client, data->hwnd, fbconfig_id );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 527f9f5..862ac8d 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -677,6 +677,7 @@ struct x11drv_win_data
     Window      client_window;  /* X window for the client area */
     Window      icon_window;    /* X window for the icon */
     Colormap    colormap;       /* Colormap for this window */
+    VisualID    visualid;       /* visual id of the client window */
     XID         fbconfig_id;    /* fbconfig id for the GL drawable this hwnd uses */
     Drawable    gl_drawable;    /* Optional GL drawable for rendering the client area */
     Pixmap      pixmap;         /* Base pixmap for if gl_drawable is a GLXPixmap */




More information about the wine-cvs mailing list