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