summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-05-15 10:14:45 +0000
committerDana Jansens <danakj@orodu.net>2002-05-15 10:14:45 +0000
commit788754fec3eb30dca567c047601d4c5791457c8c (patch)
tree271847be74598e6cbf0dc75fc33300ff7a442ea6 /util
parentc1bf229290194d5768a43f68b09ff0320848dc8e (diff)
better setting of atoms. plugged memory leak.
Diffstat (limited to 'util')
-rw-r--r--util/bsetroot.cc21
1 files changed, 6 insertions, 15 deletions
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(),