UPDATED: stop crashes in desktop mode
Alex Pasadyn
ajp at mail.utexas.edu
Mon Sep 29 14:01:52 CDT 2003
Updated to change error reporting... new file attached...
Alex Pasadyn wrote:
> 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 29 Sep 2003 19:00:03 -0000
@@ -589,7 +589,29 @@
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 parents (%lx and %lx) differ -> ignoring\n", parent_ret, parent2_ret);
+ mask &= ~CWSibling;
+ }
+ }
+ XConfigureWindow( display, data->whole_window, mask, &changes );
+ }
wine_tsx11_unlock();
}
return mask;
More information about the wine-patches
mailing list