winex11: When re-creating a client window check the new visual against the current one instead of the default one.
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 @@
     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 @@
                             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 @@
         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 @@
         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 @@
     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 */