summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/parse.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/parse.c b/src/parse.c
index 6ae9685..787e1b1 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -954,16 +954,15 @@ put_pixel_on_root(Pixel pixel)
unsigned char*retProp;
Pixel *pixelProp;
pixelAtom = XInternAtom(dpy, "_MIT_PRIORITY_COLORS", True);
- XGetWindowProperty(dpy, Scr->Root, pixelAtom, 0, 8192,
- False, XA_CARDINAL, &retAtom,
- &retFormat, &nPixels, &retAfter,
- &retProp);
-
- pixelProp = (Pixel *) retProp;
- for (i=0; i< nPixels; i++)
- if (pixel == pixelProp[i])
- addPixel = 0;
-
+ if (XGetWindowProperty(dpy, Scr->Root, pixelAtom, 0, 8192,
+ False, XA_CARDINAL, &retAtom,
+ &retFormat, &nPixels, &retAfter,
+ &retProp) == Success) {
+ pixelProp = (Pixel *) retProp;
+ for (i = 0; i < nPixels; i++)
+ if (pixel == pixelProp[i])
+ addPixel = 0;
+ }
if (addPixel)
XChangeProperty (dpy, Scr->Root, _XA_MIT_PRIORITY_COLORS,
XA_CARDINAL, 32, PropModeAppend,