… | |
… | |
227 | { |
227 | { |
228 | } |
228 | } |
229 | |
229 | |
230 | rxvt_drawable &rxvt_screen::scratch_drawable (int w, int h) |
230 | rxvt_drawable &rxvt_screen::scratch_drawable (int w, int h) |
231 | { |
231 | { |
232 | // it's actually faster to re-allocate every time. don't ask me |
|
|
233 | // why, but its likely no big deal there are no roundtrips |
|
|
234 | // (I think/hope). |
|
|
235 | if (!scratch_area || w > scratch_w || h > scratch_h || 1/*D*/) |
232 | if (!scratch_area || w > scratch_w || h > scratch_h) |
236 | { |
233 | { |
237 | if (scratch_area) |
234 | if (scratch_area) |
238 | { |
235 | { |
239 | XFreePixmap (dpy, scratch_area->drawable); |
236 | XFreePixmap (dpy, scratch_area->drawable); |
240 | delete scratch_area; |
237 | delete scratch_area; |
… | |
… | |
314 | /* |
311 | /* |
315 | * get resources using the X library function |
312 | * get resources using the X library function |
316 | */ |
313 | */ |
317 | char *displayResource, *xe; |
314 | char *displayResource, *xe; |
318 | XrmDatabase rdb1, database = 0; |
315 | XrmDatabase rdb1, database = 0; |
|
|
316 | |
|
|
317 | #if !XLIB_ILLEGAL_ACCESS |
|
|
318 | /* work around a bug in XrmSetDatabase where it frees the db, see ref_next */ |
|
|
319 | database = XrmGetStringDatabase (""); |
|
|
320 | #endif |
319 | |
321 | |
320 | // for ordering, see for example http://www.faqs.org/faqs/Xt-FAQ/ Subject: 20 |
322 | // for ordering, see for example http://www.faqs.org/faqs/Xt-FAQ/ Subject: 20 |
321 | // as opposed to "standard practise", we always read in ~/.Xdefaults |
323 | // as opposed to "standard practise", we always read in ~/.Xdefaults |
322 | |
324 | |
323 | // 6. System wide per application default file. |
325 | // 6. System wide per application default file. |
… | |
… | |
446 | return false; |
448 | return false; |
447 | |
449 | |
448 | screen = DefaultScreen (dpy); |
450 | screen = DefaultScreen (dpy); |
449 | root = DefaultRootWindow (dpy); |
451 | root = DefaultRootWindow (dpy); |
450 | |
452 | |
451 | assert (sizeof (xa_names) / sizeof (char *) == NUM_XA); |
453 | assert (ARRAY_LENGTH(xa_names) == NUM_XA); |
452 | XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa); |
454 | XInternAtoms (dpy, (char **)xa_names, NUM_XA, False, xa); |
453 | |
455 | |
454 | XrmSetDatabase (dpy, get_resources (false)); |
456 | XrmSetDatabase (dpy, get_resources (false)); |
455 | |
457 | |
456 | #ifdef POINTER_BLANK |
458 | #ifdef POINTER_BLANK |
… | |
… | |
491 | rxvt_display::ref_next () |
493 | rxvt_display::ref_next () |
492 | { |
494 | { |
493 | // TODO: somehow check whether the database files/resources changed |
495 | // TODO: somehow check whether the database files/resources changed |
494 | // before affording re-loading/parsing |
496 | // before affording re-loading/parsing |
495 | XrmDestroyDatabase (XrmGetDatabase (dpy)); |
497 | XrmDestroyDatabase (XrmGetDatabase (dpy)); |
|
|
498 | #if XLIB_ILLEGAL_ACCESS |
|
|
499 | /* work around a bug in XrmSetDatabase where it frees the db */ |
|
|
500 | dpy->db = 0; |
|
|
501 | #endif |
496 | XrmSetDatabase (dpy, get_resources (true)); |
502 | XrmSetDatabase (dpy, get_resources (true)); |
497 | } |
503 | } |
498 | |
504 | |
499 | rxvt_display::~rxvt_display () |
505 | rxvt_display::~rxvt_display () |
500 | { |
506 | { |
… | |
… | |
507 | x_ev.stop (); |
513 | x_ev.stop (); |
508 | flush_ev.stop (); |
514 | flush_ev.stop (); |
509 | #ifdef USE_XIM |
515 | #ifdef USE_XIM |
510 | xims.clear (); |
516 | xims.clear (); |
511 | #endif |
517 | #endif |
|
|
518 | XrmDestroyDatabase (XrmGetDatabase (dpy)); |
512 | XCloseDisplay (dpy); |
519 | XCloseDisplay (dpy); |
513 | } |
520 | } |
514 | |
521 | |
515 | #ifdef USE_XIM |
522 | #ifdef USE_XIM |
516 | void rxvt_display::im_change_cb () |
523 | void rxvt_display::im_change_cb () |