--- rxvt-unicode/src/rxvttoolkit.C 2004/12/15 05:30:40 1.8 +++ rxvt-unicode/src/rxvttoolkit.C 2005/07/07 19:37:47 1.14 @@ -84,7 +84,7 @@ } template -refcache::~refcache () +void refcache::clear () { while (this->size ()) put (*this->begin ()); @@ -145,7 +145,21 @@ bool rxvt_display::init () { - display = XOpenDisplay (id); +#ifdef LOCAL_X_IS_UNIX + if (id[0] == ':') + { + val = rxvt_malloc (5 + strlen (id) + 1); + strcpy (val, "unix/"); + strcat (val, id); + display = XOpenDisplay (val); + free (val); + } + else + display = 0; +#endif + + if (!display) + display = XOpenDisplay (id); if (!display) return false; @@ -170,6 +184,17 @@ is_local = sa.sun_family == AF_LOCAL; #endif +#ifdef POINTER_BLANK + XColor blackcolour; + blackcolour.red = 0; + blackcolour.green = 0; + blackcolour.blue = 0; + Font f = XLoadFont (display, "fixed"); + blank_cursor = XCreateGlyphCursor (display, f, f, ' ', ' ', + &blackcolour, &blackcolour); + XUnloadFont (display, f); +#endif + #ifdef PREFER_24BIT /* * If depth is not 24, look for a 24bit visual. @@ -205,6 +230,9 @@ rxvt_display::~rxvt_display () { x_ev.stop (); +#ifdef USE_XIM + xims.clear (); +#endif if (display) XCloseDisplay (display); @@ -219,7 +247,7 @@ void rxvt_display::im_change_check () { - // make sure we only call im_change_cb when a new input method + // try to only call im_change_cb when a new input method // registers, as xlib crashes due to a race otherwise. Atom actual_type, *atoms; int actual_format; @@ -272,11 +300,14 @@ } while (XEventsQueued (display, QueuedAlready)); - flush (); + XFlush (display); } void rxvt_display::flush () { + if (XEventsQueued (display, QueuedAlready)) + x_cb (x_ev, EVENT_READ); + XFlush (display); } @@ -334,7 +365,9 @@ void rxvt_display::put_xim (rxvt_xim *xim) { +#if XLIB_IS_RACEFREE xims.put (xim); +#endif } #endif