… | |
… | |
227 | return true; |
227 | return true; |
228 | } |
228 | } |
229 | |
229 | |
230 | rxvt_display::~rxvt_display () |
230 | rxvt_display::~rxvt_display () |
231 | { |
231 | { |
|
|
232 | if (!display) |
|
|
233 | return; |
|
|
234 | |
|
|
235 | #ifdef POINTER_BLANK |
|
|
236 | XFreeCursor (display, blank_cursor); |
|
|
237 | #endif |
232 | x_ev.stop (); |
238 | x_ev.stop (); |
233 | #ifdef USE_XIM |
239 | #ifdef USE_XIM |
234 | xims.clear (); |
240 | xims.clear (); |
235 | #endif |
241 | #endif |
236 | |
|
|
237 | if (display) |
|
|
238 | XCloseDisplay (display); |
242 | XCloseDisplay (display); |
239 | } |
243 | } |
240 | |
244 | |
241 | #ifdef USE_XIM |
245 | #ifdef USE_XIM |
242 | void rxvt_display::im_change_cb () |
246 | void rxvt_display::im_change_cb () |
243 | { |
247 | { |
… | |
… | |
279 | XNextEvent (display, &xev); |
283 | XNextEvent (display, &xev); |
280 | |
284 | |
281 | #ifdef USE_XIM |
285 | #ifdef USE_XIM |
282 | if (!XFilterEvent (&xev, None)) |
286 | if (!XFilterEvent (&xev, None)) |
283 | { |
287 | { |
284 | |
|
|
285 | if (xev.type == PropertyNotify |
288 | if (xev.type == PropertyNotify |
286 | && xev.xany.window == root |
289 | && xev.xany.window == root |
287 | && xev.xproperty.atom == xa_xim_servers) |
290 | && xev.xproperty.atom == xa_xim_servers) |
288 | im_change_check (); |
291 | im_change_check (); |
289 | #endif |
292 | #endif |
… | |
… | |
491 | ); |
494 | ); |
492 | |
495 | |
493 | return faded; |
496 | return faded; |
494 | } |
497 | } |
495 | |
498 | |
496 | #define LERP(a,b,p) (a * p / 100 + b * (100 - p) / 100) |
499 | #define LERP(a,b,p) (a * p + b * (100 - p)) / 100 |
497 | |
500 | |
498 | rxvt_color |
501 | rxvt_color |
499 | rxvt_color::fade (rxvt_display *display, int percent, rxvt_color &fadeto) |
502 | rxvt_color::fade (rxvt_display *display, int percent, rxvt_color &fadeto) |
500 | { |
503 | { |
501 | percent = 100 - percent; |
504 | percent = 100 - percent; |