--- rxvt-unicode/src/rxvttoolkit.C 2007/06/09 13:04:27 1.66 +++ rxvt-unicode/src/rxvttoolkit.C 2007/11/10 23:10:55 1.74 @@ -66,7 +66,7 @@ "WM_LOCALE_NAME", "XIM_SERVERS", #endif -#ifdef TRANSPARENT +#ifdef ENABLE_TRANSPARENCY "_XROOTPMAP_ID", "ESETROOT_PMAP_ID", #endif @@ -185,7 +185,7 @@ ximcallback.client_data = (XPointer)this; ximcallback.callback = im_destroy_cb; - XSetIMValues (xim, XNDestroyCallback, &ximcallback, 0); + XSetIMValues (xim, XNDestroyCallback, &ximcallback, (char *)0); return true; } @@ -445,12 +445,6 @@ screen = DefaultScreen (dpy); root = DefaultRootWindow (dpy); -#ifdef HAVE_AFTERIMAGE - ::dpy = dpy; /* init global var from libAfter... */ - asv = create_asvisual_for_id (dpy, screen, DefaultDepth (dpy,screen), - XVisualIDFromVisual (DefaultVisual (dpy, screen)), None, NULL); -#endif - assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa); @@ -477,7 +471,7 @@ socklen_t sl = sizeof (sa); if (!getsockname (fd, (sockaddr *)&sa, &sl)) - is_local = sa.sun_family == AF_LOCAL; + is_local = sa.sun_family == AF_UNIX; x_ev.start (fd, EVENT_READ); fcntl (fd, F_SETFD, FD_CLOEXEC); @@ -561,6 +555,9 @@ && xev.xproperty.atom == xa[XA_XIM_SERVERS]) im_change_check (); #endif + if (xev.type == MappingNotify) + XRefreshKeyboardMapping (&xev.xmapping); + for (int i = xw.size (); i--; ) { if (!xw[i]) @@ -671,7 +668,7 @@ { return (value * (mask + 1) >> 16) << shift; } - + bool rxvt_color::alloc (rxvt_screen *screen, const rgba &color) { @@ -748,10 +745,22 @@ else c.a = rgba::MAX_CC; + // parse the non-standard "#aarrggbb" format + if (name[0] == '#' && strlen (name) == 1+2+2+2+2 && 4 == sscanf (name+1, "%2hx%2hx%2hx%2hx%c", &c.a, &c.r, &c.g, &c.b, &eos)) + { + if (c.r) + c.r = (c.r << 8) | 0x0ff; + if (c.g) + c.g = (c.g << 8) | 0x0ff; + if (c.b) + c.b = (c.b << 8) | 0x0ff; + if (c.a) + c.a = (c.a << 8) | 0x0ff; + } // parse the non-standard "rgba:rrrr/gggg/bbbb/aaaa" format - if (strlen (name) != 4+5*4 || 4 != sscanf (name, "rgba:%4hx/%4hx/%4hx/%4hx%c", &c.r, &c.g, &c.b, &c.a, &eos)) + else if (strlen (name) != 4+5*4 || 4 != sscanf (name, "rgba:%4hx/%4hx/%4hx/%4hx%c", &c.r, &c.g, &c.b, &c.a, &eos)) { - XColor xc, xc_exact; + XColor xc; if (XParseColor (screen->dpy, screen->cmap, name, &xc)) { @@ -788,7 +797,7 @@ for (int i = 0; i < cmap_size; i++) colors [i].pixel = i; - + // many kilobytes transfer per colour, but pseudocolor isn't worth // many extra optimisations. XQueryColors (screen->dpy, screen->cmap, colors, cmap_size); @@ -811,7 +820,7 @@ //rxvt_warn ("could not allocate %04x %04x %04x, getting %04x %04x %04x instead (%d)\n", // color.r, color.g, color.b, best->red, best->green, best->blue, diff); - + got = alloc (screen, rgba (best->red, best->green, best->blue)); delete [] colors; @@ -849,7 +858,7 @@ color.pixel = (Pixel)*this; } -void +void rxvt_color::free (rxvt_screen *screen) { if (screen->visual->c_class == TrueColor)