PATCH: stop crashes in desktop mode

Alex Pasadyn ajp at mail.utexas.edu
Sat Sep 27 22:41:12 CDT 2003


Greetings all,
On my system, I get a lot of crashes when using the Wine desktop mode, 
especially if I try to run more than one application at a time.  For 
example, starting two Notepads crashes for me with a BadMatch X error. 
Upon examination, that happens because the CWSibling flag is used in 
XConfigureWindow for two windows that aren't siblings.

This patch just puts in a simple check that traps this condition so Wine 
doesn't crash.  I don't know enough about what that code is supposed to 
be doing to fix it properly.  (This is certainly better enough on my 
system though as it longer crashes!)  If someone wants to describe what 
"should" happen there I can look into really fixing it.

-ajp

ChangeLog:
- Trap a condition that caused X errors in Wine desktop mode
-------------- next part --------------
Index: dlls/x11drv/window.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/window.c,v
retrieving revision 1.57
diff -u -r1.57 window.c
--- dlls/x11drv/window.c	5 Sep 2003 23:08:26 -0000	1.57
+++ dlls/x11drv/window.c	28 Sep 2003 03:34:38 -0000
@@ -589,7 +589,32 @@
             XReconfigureWMWindow( display, data->whole_window,
                                   DefaultScreen(display), mask, &changes );
         }
-        else XConfigureWindow( display, data->whole_window, mask, &changes );
+        else 
+        {
+            if (mask&CWSibling)
+            {
+                /* make sure windows really are siblings */
+                Window root_ret, parent_ret, parent2_ret, *children_ret;
+                unsigned int nchildren_ret;
+                children_ret=NULL;
+                XQueryTree(display, data->whole_window, &root_ret, 
+                           &parent_ret, &children_ret, &nchildren_ret);
+                if (nchildren_ret) XFree(children_ret);
+                children_ret=NULL;
+                XQueryTree(display, changes.sibling, &root_ret, 
+                           &parent2_ret, &children_ret, &nchildren_ret);
+                if (nchildren_ret) XFree(children_ret);
+                if (parent_ret != parent2_ret)
+                {
+                    ERR("CWSibling specified, but\n");
+                    ERR("    parent1 = %lx\n", parent_ret);
+                    ERR("    parent2 = %lx\n", parent2_ret);
+                    ERR("    --> ignoring CWSibling\n");
+                    mask &= ~CWSibling;
+                }
+            }
+            XConfigureWindow( display, data->whole_window, mask, &changes );
+        }
         wine_tsx11_unlock();
     }
     return mask;


More information about the wine-patches mailing list