… | |
… | |
82 | delete obj; |
82 | delete obj; |
83 | } |
83 | } |
84 | } |
84 | } |
85 | |
85 | |
86 | template<class T> |
86 | template<class T> |
87 | refcache<T>::~refcache () |
87 | void 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 | |
205 | rxvt_display::~rxvt_display () |
216 | rxvt_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 | |
… | |
… | |
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 | |
278 | void rxvt_display::flush () |
292 | void 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 | |
289 | void rxvt_display::reg (xevent_watcher *w) |
300 | void 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 | |
341 | void rxvt_display::put_xim (rxvt_xim *xim) |
352 | void 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 | |
347 | Atom rxvt_display::atom (const char *name) |
360 | Atom rxvt_display::atom (const char *name) |
348 | { |
361 | { |