… | |
… | |
377 | } |
377 | } |
378 | |
378 | |
379 | void |
379 | void |
380 | rxvt_term::destroy_cb (time_watcher &w) |
380 | rxvt_term::destroy_cb (time_watcher &w) |
381 | { |
381 | { |
382 | SET_R (this); |
382 | make_current (); |
383 | |
383 | |
384 | delete this; |
384 | delete this; |
385 | } |
385 | } |
386 | |
386 | |
387 | /*----------------------------------------------------------------------*/ |
387 | /*----------------------------------------------------------------------*/ |
… | |
… | |
478 | /*----------------------------------------------------------------------*/ |
478 | /*----------------------------------------------------------------------*/ |
479 | bool |
479 | bool |
480 | rxvt_term::init (int argc, const char *const *argv) |
480 | rxvt_term::init (int argc, const char *const *argv) |
481 | { |
481 | { |
482 | SET_R (this); |
482 | SET_R (this); |
483 | TEMP_ENV; // few things in X do not call setlocale :( |
|
|
484 | |
|
|
485 | set_locale (""); |
483 | set_locale (""); |
|
|
484 | set_environ (envv); // few things in X do not call setlocale :( |
486 | |
485 | |
487 | if (!init_vars ()) |
486 | if (!init_vars ()) |
488 | return false; |
487 | return false; |
489 | |
488 | |
490 | init_secondary (); |
489 | init_secondary (); |
… | |
… | |
522 | rs[Rs_perl_lib] = 0; |
521 | rs[Rs_perl_lib] = 0; |
523 | rs[Rs_perl_eval] = 0; |
522 | rs[Rs_perl_eval] = 0; |
524 | } |
523 | } |
525 | } |
524 | } |
526 | #endif |
525 | #endif |
527 | rxvt_perl.init (); |
526 | rxvt_perl.init (this); |
528 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
527 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
529 | } |
528 | } |
530 | #endif |
529 | #endif |
531 | |
530 | |
532 | create_windows (argc, argv); |
531 | create_windows (argc, argv); |
… | |
… | |
615 | sw_int (this, &sig_handlers::sig_term) |
614 | sw_int (this, &sig_handlers::sig_term) |
616 | { |
615 | { |
617 | } |
616 | } |
618 | } sig_handlers; |
617 | } sig_handlers; |
619 | |
618 | |
|
|
619 | char **rxvt_environ; // startup environment |
|
|
620 | |
620 | void |
621 | void |
621 | rxvt_init () |
622 | rxvt_init () |
622 | { |
623 | { |
|
|
624 | rxvt_environ = environ; |
|
|
625 | |
623 | /* |
626 | /* |
624 | * Save and then give up any super-user privileges |
627 | * Save and then give up any super-user privileges |
625 | * If we need privileges in any area then we must specifically request it. |
628 | * If we need privileges in any area then we must specifically request it. |
626 | * We should only need to be root in these cases: |
629 | * We should only need to be root in these cases: |
627 | * 1. write utmp entries on some systems |
630 | * 1. write utmp entries on some systems |
… | |
… | |
1446 | unsigned long fg, bg; |
1449 | unsigned long fg, bg; |
1447 | const char *p; |
1450 | const char *p; |
1448 | char **s; |
1451 | char **s; |
1449 | XIMStyles *xim_styles; |
1452 | XIMStyles *xim_styles; |
1450 | |
1453 | |
1451 | TEMP_ENV; |
1454 | set_environ (envv); |
1452 | |
1455 | |
1453 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1456 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1454 | return false; |
1457 | return false; |
1455 | |
1458 | |
1456 | D_MAIN ((stderr, "rxvt_IM_get_IC ()")); |
1459 | D_MAIN ((stderr, "rxvt_IM_get_IC ()")); |
… | |
… | |
1622 | int i; |
1625 | int i; |
1623 | const char *p; |
1626 | const char *p; |
1624 | char **s; |
1627 | char **s; |
1625 | char buf[IMBUFSIZ]; |
1628 | char buf[IMBUFSIZ]; |
1626 | |
1629 | |
1627 | SET_R (this); |
1630 | make_current (); |
1628 | |
1631 | |
1629 | im_destroy (); |
1632 | im_destroy (); |
1630 | |
1633 | |
1631 | D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()")); |
1634 | D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()")); |
1632 | if (Input_Context) |
1635 | if (Input_Context) |