ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.173 by root, Wed Jan 11 19:55:34 2006 UTC vs.
Revision 1.177 by root, Mon Jan 16 06:37:52 2006 UTC

89rxvt_pop_locale () 89rxvt_pop_locale ()
90{ 90{
91 rxvt_set_locale (savelocale); 91 rxvt_set_locale (savelocale);
92} 92}
93 93
94void
95rxvt_term::make_current () const
96{
97 SET_R (this);
98 rxvt_set_locale (locale);
99 set_environ (envv);
100}
101
94#if ENABLE_COMBINING 102#if ENABLE_COMBINING
95class rxvt_composite_vec rxvt_composite; 103class rxvt_composite_vec rxvt_composite;
96 104
97text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2) 105text_t rxvt_composite_vec::compose (unicode_t c1, unicode_t c2)
98{ 106{
377} 385}
378 386
379void 387void
380rxvt_term::destroy_cb (time_watcher &w) 388rxvt_term::destroy_cb (time_watcher &w)
381{ 389{
382 SET_R (this); 390 make_current ();
383 391
384 delete this; 392 delete this;
385} 393}
386 394
387/*----------------------------------------------------------------------*/ 395/*----------------------------------------------------------------------*/
478/*----------------------------------------------------------------------*/ 486/*----------------------------------------------------------------------*/
479bool 487bool
480rxvt_term::init (int argc, const char *const *argv) 488rxvt_term::init (int argc, const char *const *argv)
481{ 489{
482 SET_R (this); 490 SET_R (this);
483 TEMP_ENV; // few things in X do not call setlocale :(
484
485 set_locale (""); 491 set_locale ("");
492 set_environ (envv); // few things in X do not call setlocale :(
486 493
487 if (!init_vars ()) 494 if (!init_vars ())
488 return false; 495 return false;
489 496
490 init_secondary (); 497 init_secondary ();
523 rs[Rs_perl_eval] = 0; 530 rs[Rs_perl_eval] = 0;
524 } 531 }
525 } 532 }
526#endif 533#endif
527 rxvt_perl.init (); 534 rxvt_perl.init ();
535 setlocale (LC_CTYPE, curlocale); // perl init destroys current locale
528 HOOK_INVOKE ((this, HOOK_INIT, DT_END)); 536 HOOK_INVOKE ((this, HOOK_INIT, DT_END));
529 } 537 }
530#endif 538#endif
531 539
532 create_windows (argc, argv); 540 create_windows (argc, argv);
615 sw_int (this, &sig_handlers::sig_term) 623 sw_int (this, &sig_handlers::sig_term)
616 { 624 {
617 } 625 }
618} sig_handlers; 626} sig_handlers;
619 627
628char **rxvt_environ; // startup environment
629
620void 630void
621rxvt_init () 631rxvt_init ()
622{ 632{
633 rxvt_environ = environ;
634
623 /* 635 /*
624 * Save and then give up any super-user privileges 636 * Save and then give up any super-user privileges
625 * If we need privileges in any area then we must specifically request it. 637 * If we need privileges in any area then we must specifically request it.
626 * We should only need to be root in these cases: 638 * We should only need to be root in these cases:
627 * 1. write utmp entries on some systems 639 * 1. write utmp entries on some systems
1446 unsigned long fg, bg; 1458 unsigned long fg, bg;
1447 const char *p; 1459 const char *p;
1448 char **s; 1460 char **s;
1449 XIMStyles *xim_styles; 1461 XIMStyles *xim_styles;
1450 1462
1451 TEMP_ENV; 1463 set_environ (envv);
1452 1464
1453 if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) 1465 if (! ((p = XSetLocaleModifiers (modifiers)) && *p))
1454 return false; 1466 return false;
1455 1467
1456 D_MAIN ((stderr, "rxvt_IM_get_IC ()")); 1468 D_MAIN ((stderr, "rxvt_IM_get_IC ()"));
1622 int i; 1634 int i;
1623 const char *p; 1635 const char *p;
1624 char **s; 1636 char **s;
1625 char buf[IMBUFSIZ]; 1637 char buf[IMBUFSIZ];
1626 1638
1627 SET_R (this); 1639 make_current ();
1628 1640
1629 im_destroy (); 1641 im_destroy ();
1630 1642
1631 D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()")); 1643 D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()"));
1632 if (Input_Context) 1644 if (Input_Context)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines