diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-05-14 23:07:54 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-05-14 23:07:54 +0000 |
| commit | f7ace0fad8ddfc2cfc9e3a127ff00c6338958078 (patch) | |
| tree | 8d927d6bd4e32cd6163e83e9863b58e089566061 /util/bsetroot.cc | |
| parent | f75083669f65aadd6b32f8ed25880ca362296a2f (diff) | |
new version of bsetbg
bsetroot now plays niecly with Eterm. Also, updated to the latest bsetroot from blackbox cvs
Diffstat (limited to 'util/bsetroot.cc')
| -rw-r--r-- | util/bsetroot.cc | 38 |
1 files changed, 21 insertions, 17 deletions
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 |
