X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fbsetroot.cc;h=918a31fe2c936c8ec9da2731dea823308a089ca0;hb=a3a23c28f0fa4ed8b42ccde4a4b99aec60583df5;hp=303323dff7e6f35b675808ee0616a49bcffb814a;hpb=c1bf229290194d5768a43f68b09ff0320848dc8e;p=chaz%2Fopenbox diff --git a/util/bsetroot.cc b/util/bsetroot.cc index 303323df..918a31fe 100644 --- a/util/bsetroot.cc +++ b/util/bsetroot.cc @@ -136,8 +136,6 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) { int format; unsigned long length, after; unsigned char *data; - int mode = PropModeAppend; - int emode = PropModeAppend; const ScreenInfo *screen_info = getScreenInfo(screen); if (rootpmap_id == None) { @@ -147,29 +145,22 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) { XGrabServer(getXDisplay()); - // Clear out the old pixmap? + // Clear out the old pixmap XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, 0L, 1L, False, AnyPropertyType, + rootpmap_id, 0L, 1L, False, XA_PIXMAP, &type, &format, &length, &after, &data); - if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) { + if (type == XA_PIXMAP && format == 32) { XKillClient(getXDisplay(), *((Pixmap *) data)); XSync(getXDisplay(), False); - mode = PropModeReplace; + XFree(data); } - // Clear out the old esetroot pixmap? - XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data); - if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) - emode = PropModeReplace; - if (pixmap) { XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, XA_PIXMAP, 32, mode, + rootpmap_id, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &pixmap, 1); XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, XA_PIXMAP, 32, emode, + esetroot_id, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &pixmap, 1); } else { XDeleteProperty(getXDisplay(), screen_info->getRootWindow(),