From f7ace0fad8ddfc2cfc9e3a127ff00c6338958078 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 14 May 2002 23:07:54 +0000 Subject: new version of bsetbg bsetroot now plays niecly with Eterm. Also, updated to the latest bsetroot from blackbox cvs --- util/bsetroot.cc | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'util/bsetroot.cc') diff --git a/util/bsetroot.cc b/util/bsetroot.cc index 5d9203d0..39d8b2c7 100644 --- a/util/bsetroot.cc +++ b/util/bsetroot.cc @@ -137,38 +137,39 @@ void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) { unsigned long length, after; unsigned char *data; int mode = PropModeAppend; + int emode = PropModeAppend; const ScreenInfo *screen_info = getScreenInfo(screen); if (rootpmap_id == None) { rootpmap_id = XInternAtom(getXDisplay(), "_XROOTPMAP_ID", True); - esetroot_id = XInternAtom(getXDisplay(), "_ESETROOT_PMAP_ID", True); + esetroot_id = XInternAtom(getXDisplay(), "ESETROOT_PMAP_ID", True); } XGrabServer(getXDisplay()); - /* Clear out the old pixmap */ + // Clear out the old pixmap? XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data); - + rootpmap_id, 0L, 1L, False, AnyPropertyType, + &type, &format, &length, &after, &data); if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) { - unsigned char* data_esetroot = 0; - XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data); - if (data && data_esetroot && *((Pixmap *) data)) { - XKillClient(getXDisplay(), *((Pixmap *) data)); - XSync(getXDisplay(), False); - mode = PropModeReplace; - } + XKillClient(getXDisplay(), *((Pixmap *) data)); + XSync(getXDisplay(), False); + mode = PropModeReplace; } + // 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, (unsigned char *) &pixmap, 1); XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, XA_PIXMAP, 32, mode, + esetroot_id, XA_PIXMAP, 32, emode, (unsigned char *) &pixmap, 1); } else { XDeleteProperty(getXDisplay(), screen_info->getRootWindow(), @@ -215,6 +216,9 @@ void bsetroot::solid(void) { Pixmap pixmap = XCreatePixmap(getXDisplay(), screen_info->getRootWindow(), 8, 8, DefaultDepth(getXDisplay(), screen)); + + XSetForeground(getXDisplay(), DefaultGC(getXDisplay(), screen), + c.getPixel()); XFillRectangle(getXDisplay(), pixmap, DefaultGC(getXDisplay(), screen), 0, 0, 8, 8); @@ -353,8 +357,8 @@ void bsetroot::usage(int exit_code) { int main(int argc, char **argv) { char *display_name = (char *) 0; - i18n->openCatalog("blackbox.cat"); - + NLSInit("openbox.cat"); + for (int i = 1; i < argc; i++) { if (! strcmp(argv[i], "-display")) { // check for -display option -- cgit v1.2.3