… | |
… | |
268 | } |
268 | } |
269 | #ifdef USE_XIM |
269 | #ifdef USE_XIM |
270 | } |
270 | } |
271 | #endif |
271 | #endif |
272 | } |
272 | } |
273 | while (XPending (display)); |
273 | while (XEventsQueued (display, QueuedAlready)); |
274 | |
274 | |
275 | flush (); |
275 | flush (); |
276 | } |
276 | } |
277 | |
277 | |
278 | void rxvt_display::flush () |
278 | void rxvt_display::flush () |
279 | { |
279 | { |
280 | for (;;) |
280 | XFlush (display); |
281 | { |
|
|
282 | if (!XPending (display)) |
|
|
283 | break; |
|
|
284 | |
|
|
285 | x_cb (x_ev, 0); |
|
|
286 | } |
|
|
287 | } |
281 | } |
288 | |
282 | |
289 | void rxvt_display::reg (xevent_watcher *w) |
283 | void rxvt_display::reg (xevent_watcher *w) |
290 | { |
284 | { |
291 | xw.push_back (w); |
285 | xw.push_back (w); |
… | |
… | |
386 | } |
380 | } |
387 | |
381 | |
388 | bool |
382 | bool |
389 | rxvt_color::set (rxvt_display *display, const char *name) |
383 | rxvt_color::set (rxvt_display *display, const char *name) |
390 | { |
384 | { |
|
|
385 | #if XFT |
|
|
386 | return XftColorAllocName (display->display, display->visual, display->cmap, |
|
|
387 | name, &c); |
|
|
388 | #else |
391 | XColor xc; |
389 | XColor xc; |
392 | |
390 | |
393 | if (XParseColor (display->display, display->cmap, name, &xc)) |
391 | if (XParseColor (display->display, display->cmap, name, &xc)) |
394 | return set (display, xc.red, xc.green, xc.blue); |
392 | return set (display, xc.red, xc.green, xc.blue); |
395 | |
393 | |
396 | return false; |
394 | return false; |
|
|
395 | #endif |
397 | } |
396 | } |
398 | |
397 | |
399 | bool |
398 | bool |
400 | rxvt_color::set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb) |
399 | rxvt_color::set (rxvt_display *display, unsigned short cr, unsigned short cg, unsigned short cb) |
401 | { |
400 | { |