… | |
… | |
76 | strncpy (curlocale, locale, 128); |
76 | strncpy (curlocale, locale, 128); |
77 | setlocale (LC_CTYPE, curlocale); |
77 | setlocale (LC_CTYPE, curlocale); |
78 | return true; |
78 | return true; |
79 | } |
79 | } |
80 | |
80 | |
81 | bool |
81 | void |
82 | rxvt_push_locale (const char *locale) |
82 | rxvt_push_locale (const char *locale) |
83 | { |
83 | { |
84 | strcpy (savelocale, curlocale); |
84 | strcpy (savelocale, curlocale); |
85 | rxvt_set_locale (locale); |
85 | rxvt_set_locale (locale); |
86 | } |
86 | } |
… | |
… | |
284 | if (parent[0]) |
284 | if (parent[0]) |
285 | XDestroyWindow (disp, parent[0]); |
285 | XDestroyWindow (disp, parent[0]); |
286 | } |
286 | } |
287 | |
287 | |
288 | // TODO: free pixcolours, colours should become part of rxvt_display |
288 | // TODO: free pixcolours, colours should become part of rxvt_display |
289 | |
|
|
290 | delete pix_colors_focused; |
289 | delete pix_colors_focused; |
291 | #if OFF_FOCUS_FADING |
290 | #if OFF_FOCUS_FADING |
292 | delete pix_colors_unfocused; |
291 | delete pix_colors_unfocused; |
293 | #endif |
|
|
294 | #if USE_XGETDEFAULT |
|
|
295 | XrmDestroyDatabase (xrmdatabase); |
|
|
296 | #endif |
292 | #endif |
297 | |
293 | |
298 | displays.put (display); |
294 | displays.put (display); |
299 | |
295 | |
300 | scr_release (); |
296 | scr_release (); |
… | |
… | |
482 | /*----------------------------------------------------------------------*/ |
478 | /*----------------------------------------------------------------------*/ |
483 | bool |
479 | bool |
484 | rxvt_term::init (int argc, const char *const *argv) |
480 | rxvt_term::init (int argc, const char *const *argv) |
485 | { |
481 | { |
486 | SET_R (this); |
482 | SET_R (this); |
|
|
483 | TEMP_ENV; // few things in X do not call setlocale :( |
487 | |
484 | |
488 | set_locale (""); |
485 | set_locale (""); |
489 | |
486 | |
490 | if (!init_vars ()) |
487 | if (!init_vars ()) |
491 | return false; |
488 | return false; |
… | |
… | |
536 | |
533 | |
537 | dDisp; |
534 | dDisp; |
538 | |
535 | |
539 | init_xlocale (); |
536 | init_xlocale (); |
540 | |
537 | |
541 | scr_reset (); /* initialize screen */ |
538 | scr_reset (); // initialize screen |
542 | |
539 | |
543 | #if 0 |
540 | #if 0 |
544 | XSynchronize (disp, True); |
541 | XSynchronize (disp, True); |
545 | #endif |
542 | #endif |
546 | |
543 | |
… | |
… | |
645 | |
642 | |
646 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
643 | old_xerror_handler = XSetErrorHandler ((XErrorHandler) rxvt_xerror_handler); |
647 | // TODO: handle this with exceptions and tolerate the memory loss |
644 | // TODO: handle this with exceptions and tolerate the memory loss |
648 | XSetIOErrorHandler (rxvt_xioerror_handler); |
645 | XSetIOErrorHandler (rxvt_xioerror_handler); |
649 | |
646 | |
650 | #ifdef USE_XGETDEFAULT |
|
|
651 | XrmInitialize (); |
647 | XrmInitialize (); |
652 | #endif |
|
|
653 | } |
648 | } |
654 | |
649 | |
655 | /* ------------------------------------------------------------------------- * |
650 | /* ------------------------------------------------------------------------- * |
656 | * MEMORY ALLOCATION WRAPPERS * |
651 | * MEMORY ALLOCATION WRAPPERS * |
657 | * ------------------------------------------------------------------------- */ |
652 | * ------------------------------------------------------------------------- */ |
… | |
… | |
1451 | unsigned long fg, bg; |
1446 | unsigned long fg, bg; |
1452 | const char *p; |
1447 | const char *p; |
1453 | char **s; |
1448 | char **s; |
1454 | XIMStyles *xim_styles; |
1449 | XIMStyles *xim_styles; |
1455 | |
1450 | |
|
|
1451 | TEMP_ENV; |
|
|
1452 | |
1456 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1453 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1457 | return false; |
1454 | return false; |
1458 | |
1455 | |
1459 | D_MAIN ((stderr, "rxvt_IM_get_IC ()")); |
1456 | D_MAIN ((stderr, "rxvt_IM_get_IC ()")); |
1460 | input_method = display->get_xim (locale, modifiers); |
1457 | input_method = display->get_xim (locale, modifiers); |