--- rxvt-unicode/src/rxvttoolkit.C 2008/01/23 09:14:58 1.88 +++ rxvt-unicode/src/rxvttoolkit.C 2008/11/04 11:03:29 1.102 @@ -61,6 +61,7 @@ "_NET_WM_NAME", "_NET_WM_ICON_NAME", "_NET_WM_PING", + "_NET_WM_ICON", #endif #if USE_XIM "WM_LOCALE_NAME", @@ -545,39 +546,42 @@ void rxvt_display::x_cb (ev::io &w, int revents) { - while (XEventsQueued (dpy, QueuedAfterReading)) - { - XEvent xev; - XNextEvent (dpy, &xev); + flush_ev.start (); +} + +void rxvt_display::flush_cb (ev::prepare &w, int revents) +{ + while (XEventsQueued (dpy, QueuedAfterFlush)) + do + { + XEvent xev; + XNextEvent (dpy, &xev); #ifdef USE_XIM - if (!XFilterEvent (&xev, None)) - { - if (xev.type == PropertyNotify - && xev.xany.window == root - && 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]) - xw.erase_unordered (i); - else if (xw[i]->window == xev.xany.window) - xw[i]->call (xev); - } + if (!XFilterEvent (&xev, None)) + { + if (xev.type == PropertyNotify + && xev.xany.window == root + && 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]) + xw.erase_unordered (i); + else if (xw[i]->window == xev.xany.window) + xw[i]->call (xev); + } #ifdef USE_XIM - } + } #endif - } -} + } + while (XEventsQueued (dpy, QueuedAlready)); -void rxvt_display::flush_cb (ev::prepare &w, int revents) -{ w.stop (); - XFlush (dpy); } void rxvt_display::reg (xevent_watcher *w) @@ -675,7 +679,7 @@ bool rxvt_color::alloc (rxvt_screen *screen, const rgba &color) { - //TODO: only supports 24 bit truecolour + //TODO: only supports 24 bit int alpha = color.a >= 0xff00 ? 0xffff : color.a; #if XFT @@ -742,25 +746,17 @@ char eos; int skip; + c.a = rgba::MAX_CC; + // parse the nonstandard "[alphapercent]" prefix if (1 <= sscanf (name, "[%hd]%n", &c.a, &skip)) { c.a = lerp (0, rgba::MAX_CC, c.a); name += skip; } - 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)) - { - 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)) + 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;