+2004-09-22 Dan Doel <dolio@case.edu>
+
+ * xcompmgr.c: (run_fades), (solid_picture), (get_opacity_prop),
+ (determine_wintype), (circulate_win):
+ Miscellaneous code cleanup and checks for failed allocations.
+
2004-09-21 Dan Doel <dolio@case.edu>
* xcompmgr.c: (presum_gaussian), (make_shadow), (main):
{
w->opacity = f->finish*OPAQUE;
dequeue_fade (dpy, f);
- }
+ }
}
else
{
{
w->opacity = f->finish*OPAQUE;
dequeue_fade (dpy, f);
- }
+ }
}
determine_mode (dpy, w);
if (w->shadow)
XRenderColor c;
pixmap = XCreatePixmap (dpy, root, 1, 1, argb ? 32 : 8);
+ if (!pixmap)
+ return None;
+
pa.repeat = True;
picture = XRenderCreatePicture (dpy, pixmap,
XRenderFindStandardFormat (dpy, argb ? PictStandardARGB32 : PictStandardA8),
CPRepeat,
&pa);
+ if (!picture)
+ {
+ XFreePixmap (dpy, pixmap);
+ return None;
+ }
+
c.alpha = a * 0xffff;
c.red = r * 0xffff;
c.green = g * 0xffff;
int result = XGetWindowProperty(dpy, w->id, opacityAtom, 0L, 1L, False,
XA_CARDINAL, &actual, &format,
&n, &left, &data);
- if (result == Success && data != None)
+ if (result == Success && data != NULL)
{
unsigned int i;
memcpy (&i, data, sizeof (unsigned int));
determine_wintype (Display *dpy, Window w)
{
Window root_return, parent_return;
- Window *children;
+ Window *children = NULL;
unsigned int nchildren, i;
Atom type;
&nchildren))
{
/* XQueryTree failed. */
+ if (children)
+ XFree ((void *)children);
return winNormalAtom;
}
return type;
}
+ if (children)
+ XFree ((void *)children);
+
return winNormalAtom;
}
win *w = find_win (dpy, ce->window);
Window new_above;
+ if (!w)
+ return;
+
if (ce->place == PlaceOnTop)
new_above = list->id;
else