Alexandre Julliard : winex11: Preserve the client window when changing the window visual.

Alexandre Julliard julliard at winehq.org
Wed Feb 13 13:54:29 CST 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb 13 14:51:00 2013 +0100

winex11: Preserve the client window when changing the window visual.

---

 dlls/winex11.drv/window.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 7f97330..ec15afc 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1525,12 +1525,23 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des
  */
 void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis )
 {
+    Window client_window = data->client_window;
+    Window whole_window = data->whole_window;
+
     if (data->vis.visualid == vis->visualid) return;
-    destroy_whole_window( data, FALSE );
+    data->client_window = 0;
+    destroy_whole_window( data, client_window != 0 /* don't destroy whole_window until reparented */ );
     if (data->surface) window_surface_release( data->surface );
     data->surface = NULL;
     data->vis = *vis;
     create_whole_window( data );
+    if (!client_window) return;
+    /* move the client to the new parent */
+    XReparentWindow( data->display, client_window, data->whole_window,
+                     data->client_rect.left - data->whole_rect.left,
+                     data->client_rect.top - data->whole_rect.top );
+    data->client_window = client_window;
+    XDestroyWindow( data->display, whole_window );
 }
 
 




More information about the wine-cvs mailing list