--- rxvt-unicode/src/rxvttoolkit.C 2007/12/14 06:17:27 1.84 +++ rxvt-unicode/src/rxvttoolkit.C 2008/01/23 09:14:58 1.88 @@ -503,6 +503,7 @@ XFreeCursor (dpy, blank_cursor); #endif x_ev.stop (); + flush_ev.stop (); #ifdef USE_XIM xims.clear (); #endif @@ -600,7 +601,12 @@ void rxvt_display::set_selection_owner (rxvt_term *owner) { if (selection_owner && selection_owner != owner) - selection_owner->selection_clear (); + { + rxvt_term *owner = selection_owner; + + owner->selection_clear (); + owner->flush (); + } selection_owner = owner; } @@ -669,6 +675,9 @@ bool rxvt_color::alloc (rxvt_screen *screen, const rgba &color) { + //TODO: only supports 24 bit truecolour + int alpha = color.a >= 0xff00 ? 0xffff : color.a; + #if XFT XRenderPictFormat *format; @@ -682,12 +691,12 @@ c.color.red = color.r; c.color.green = color.g; c.color.blue = color.b; - c.color.alpha = color.a; + c.color.alpha = alpha; c.pixel = insert_component (color.r, format->direct.redMask , format->direct.red ) | insert_component (color.g, format->direct.greenMask, format->direct.green) | insert_component (color.b, format->direct.blueMask , format->direct.blue ) - | insert_component (color.a, format->direct.alphaMask, format->direct.alpha); + | insert_component (alpha , format->direct.alphaMask, format->direct.alpha); return true; } @@ -698,7 +707,7 @@ d.red = color.r; d.green = color.g; d.blue = color.b; - d.alpha = color.a; + d.alpha = alpha; return XftColorAllocValue (screen->dpy, screen->visual, screen->cmap, &d, &c); } @@ -745,14 +754,10 @@ // 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; + c.r <<= 8; + c.g <<= 8; + c.b <<= 8; + c.a <<= 8; } // parse the non-standard "rgba:rrrr/gggg/bbbb/aaaa" format 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))