--- rxvt-unicode/src/rxvttoolkit.C 2012/01/02 19:30:50 1.129 +++ rxvt-unicode/src/rxvttoolkit.C 2012/06/03 15:50:22 1.132 @@ -432,10 +432,11 @@ #ifdef LOCAL_X_IS_UNIX if (id[0] == ':') { - if (!(val = rxvt_temp_buf (5 + strlen (id) + 1))) - return false; + char *val = rxvt_temp_buf (5 + strlen (id) + 1); + strcpy (val, "unix/"); strcat (val, id); + dpy = XOpenDisplay (val); } else @@ -467,6 +468,28 @@ XUnloadFont (dpy, f); #endif + flags = 0; +#if XRENDER + int major, minor; + if (XRenderQueryVersion (dpy, &major, &minor)) + { + flags |= DISPLAY_HAS_RENDER; + + if (major > 0 || (major == 0 && minor >= 11)) + flags |= DISPLAY_HAS_RENDER_MUL; + + XFilters *filters = XRenderQueryFilters (dpy, root); + if (filters) + { + for (int i = 0; i < filters->nfilter; i++) + if (!strcmp (filters->filter[i], FilterConvolution)) + flags |= DISPLAY_HAS_RENDER_CONV; + + XFree (filters); + } + } +#endif + int fd = XConnectionNumber (dpy); // try to detect whether we have a local connection. @@ -727,7 +750,8 @@ d.blue = color.b; d.alpha = alpha; - return XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c); + if (XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c)) + return true; } #else c.red = color.r; @@ -744,12 +768,12 @@ } else if (XAllocColor (screen->dpy, screen->cmap, &c)) return true; - else - c.pixel = (color.r + color.g + color.b) > 128*3 - ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy)) - : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy)); #endif + c.pixel = (color.r + color.g + color.b) > 128*3 + ? WhitePixelOfScreen (DefaultScreenOfDisplay (screen->dpy)) + : BlackPixelOfScreen (DefaultScreenOfDisplay (screen->dpy)); + return false; }