ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvttoolkit.C
(Generate patch)

Comparing rxvt-unicode/src/rxvttoolkit.C (file contents):
Revision 1.7 by root, Wed Dec 15 00:53:23 2004 UTC vs.
Revision 1.13 by root, Sun Feb 13 11:07:57 2005 UTC

82 delete obj; 82 delete obj;
83 } 83 }
84} 84}
85 85
86template<class T> 86template<class T>
87refcache<T>::~refcache () 87void refcache<T>::clear ()
88{ 88{
89 while (this->size ()) 89 while (this->size ())
90 put (*this->begin ()); 90 put (*this->begin ());
91} 91}
92 92
166 sockaddr_un sa; 166 sockaddr_un sa;
167 socklen_t sl = sizeof (sa); 167 socklen_t sl = sizeof (sa);
168 168
169 if (!getsockname (fd, (sockaddr *)&sa, &sl)) 169 if (!getsockname (fd, (sockaddr *)&sa, &sl))
170 is_local = sa.sun_family == AF_LOCAL; 170 is_local = sa.sun_family == AF_LOCAL;
171#endif
172
173#ifdef POINTER_BLANK
174 XColor blackcolour;
175 blackcolour.red = 0;
176 blackcolour.green = 0;
177 blackcolour.blue = 0;
178 Font f = XLoadFont (display, "fixed");
179 blank_cursor = XCreateGlyphCursor (display, f, f, ' ', ' ',
180 &blackcolour, &blackcolour);
181 XUnloadFont (display, f);
171#endif 182#endif
172 183
173#ifdef PREFER_24BIT 184#ifdef PREFER_24BIT
174 /* 185 /*
175 * If depth is not 24, look for a 24bit visual. 186 * If depth is not 24, look for a 24bit visual.
203} 214}
204 215
205rxvt_display::~rxvt_display () 216rxvt_display::~rxvt_display ()
206{ 217{
207 x_ev.stop (); 218 x_ev.stop ();
219#ifdef USE_XIM
220 xims.clear ();
221#endif
208 222
209 if (display) 223 if (display)
210 XCloseDisplay (display); 224 XCloseDisplay (display);
211} 225}
212 226
217 (*i)->call (); 231 (*i)->call ();
218} 232}
219 233
220void rxvt_display::im_change_check () 234void rxvt_display::im_change_check ()
221{ 235{
222 // make sure we only call im_change_cb when a new input method 236 // try to only call im_change_cb when a new input method
223 // registers, as xlib crashes due to a race otherwise. 237 // registers, as xlib crashes due to a race otherwise.
224 Atom actual_type, *atoms; 238 Atom actual_type, *atoms;
225 int actual_format; 239 int actual_format;
226 unsigned long nitems, bytes_after; 240 unsigned long nitems, bytes_after;
227 241
270 } 284 }
271#endif 285#endif
272 } 286 }
273 while (XEventsQueued (display, QueuedAlready)); 287 while (XEventsQueued (display, QueuedAlready));
274 288
275 flush (); 289 XFlush (display);
276} 290}
277 291
278void rxvt_display::flush () 292void rxvt_display::flush ()
279{ 293{
280 for (;;) 294 if (XEventsQueued (display, QueuedAlready))
281 { 295 x_cb (x_ev, EVENT_READ);
282 if (!XPending (display))
283 break;
284 296
285 x_cb (x_ev, 0); 297 XFlush (display);
286 }
287} 298}
288 299
289void rxvt_display::reg (xevent_watcher *w) 300void rxvt_display::reg (xevent_watcher *w)
290{ 301{
291 xw.push_back (w); 302 xw.push_back (w);
338 return xim; 349 return xim;
339} 350}
340 351
341void rxvt_display::put_xim (rxvt_xim *xim) 352void rxvt_display::put_xim (rxvt_xim *xim)
342{ 353{
354#if XLIB_IS_RACEFREE
343 xims.put (xim); 355 xims.put (xim);
356#endif
344} 357}
345#endif 358#endif
346 359
347Atom rxvt_display::atom (const char *name) 360Atom rxvt_display::atom (const char *name)
348{ 361{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines