Hi,

 I recently installed crossover-office and using it installed
and ran Apple's Safari browser for Windows. The application
immediately crashed my WindowMaker session and it persits doing
so. Playing a bit with the debugger and undocumented command
line options (one should be able to disable the crash dialogue
for easier debugging in such cases), I finally figured out that 
WM segfaults in wmspec.c:1276, consider this code:

  if (XGetWindowProperty(dpy, wwin->client_win, net_wm_window_type, 0, 1,
                 False, XA_ATOM, &type_ret, &fmt_ret, &nitems_ret,
                 &bytes_after_ret, (unsigned char **)&data)==Success && data) {

  /* ... */

  ChangeStackingLevel(wwin->frame->core, layer);

  /* ... */

I don't know why but for some reason in this code snippet `wwin->frame'
is NULL. I guess the reason is the weird stuff the application does
with the window decoration (look at Safari on a Windows system and
you get the idea).

I recompiled my WM Debian package with the patch appended to this
mail which is of course not more than a workaround but it at least
keeps WM from crashing.

If my assumption is true, and X11 fails to handle such windows
properly I would very much assume that the above crash is really
only the tip of the iceberg, thus a bit more of checking and
fixing will be necessary.

Cheers,

Martin

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Warum geht ein Bratscher nicht �ber einen Friedhof?
    if (XGetWindowProperty(dpy, wwin->client_win, net_wm_winZu viele Kreuze...
--- wmaker-0.92.0/src/wmspec.c-orig     2008-11-26 15:16:39.000000000 +0100
+++ wmaker-0.92.0/src/wmspec.c  2008-11-26 15:15:01.000000000 +0100
@@ -1273,10 +1273,13 @@
         XFree(data);
     }
 
-    ChangeStackingLevel(wwin->frame->core, layer);
-    wwin->frame->flags.need_texture_change = 1;
-    wWindowConfigureBorders(wwin);
-    wFrameWindowPaint(wwin->frame);
+    /* wwin-frame may be null here, thus first: avoid crash */
+    if (wwin->frame != NULL) {
+        ChangeStackingLevel(wwin->frame->core, layer);
+        wwin->frame->flags.need_texture_change = 1;
+        wWindowConfigureBorders(wwin);
+        wFrameWindowPaint(wwin->frame);
+    }
     wNETWMUpdateActions(wwin, False);
 }
 

Reply via email to