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.171 by root, Wed Jan 11 03:13:26 2006 UTC vs.
Revision 1.179 by root, Mon Jan 16 08:48:09 2006 UTC

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 292#endif
294 293
378} 377}
379 378
380void 379void
381rxvt_term::destroy_cb (time_watcher &w) 380rxvt_term::destroy_cb (time_watcher &w)
382{ 381{
383 SET_R (this); 382 make_current ();
384 383
385 delete this; 384 delete this;
386} 385}
387 386
388/*----------------------------------------------------------------------*/ 387/*----------------------------------------------------------------------*/
479/*----------------------------------------------------------------------*/ 478/*----------------------------------------------------------------------*/
480bool 479bool
481rxvt_term::init (int argc, const char *const *argv) 480rxvt_term::init (int argc, const char *const *argv)
482{ 481{
483 SET_R (this); 482 SET_R (this);
484 TEMP_ENV; // few things in X do not call setlocale :(
485
486 set_locale (""); 483 set_locale ("");
484 set_environ (envv); // few things in X do not call setlocale :(
487 485
488 if (!init_vars ()) 486 if (!init_vars ())
489 return false; 487 return false;
490 488
491 init_secondary (); 489 init_secondary ();
523 rs[Rs_perl_lib] = 0; 521 rs[Rs_perl_lib] = 0;
524 rs[Rs_perl_eval] = 0; 522 rs[Rs_perl_eval] = 0;
525 } 523 }
526 } 524 }
527#endif 525#endif
528 rxvt_perl.init (); 526 rxvt_perl.init (this);
529 HOOK_INVOKE ((this, HOOK_INIT, DT_END)); 527 HOOK_INVOKE ((this, HOOK_INIT, DT_END));
530 } 528 }
531#endif 529#endif
532 530
533 create_windows (argc, argv); 531 create_windows (argc, argv);
616 sw_int (this, &sig_handlers::sig_term) 614 sw_int (this, &sig_handlers::sig_term)
617 { 615 {
618 } 616 }
619} sig_handlers; 617} sig_handlers;
620 618
619char **rxvt_environ; // startup environment
620
621void 621void
622rxvt_init () 622rxvt_init ()
623{ 623{
624 rxvt_environ = environ;
625
624 /* 626 /*
625 * Save and then give up any super-user privileges 627 * Save and then give up any super-user privileges
626 * 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.
627 * We should only need to be root in these cases: 629 * We should only need to be root in these cases:
628 * 1. write utmp entries on some systems 630 * 1. write utmp entries on some systems
704 case IGNORE: 706 case IGNORE:
705 /* 707 /*
706 * change effective uid/gid - not real uid/gid - so we can switch 708 * change effective uid/gid - not real uid/gid - so we can switch
707 * back to root later, as required 709 * back to root later, as required
708 */ 710 */
711 setegid (getgid ());
709 seteuid (getuid ()); 712 seteuid (getuid ());
710 setegid (getgid ());
711 break; 713 break;
712 case SAVE: 714 case SAVE:
715 saved_egid = getegid ();
713 saved_euid = geteuid (); 716 saved_euid = geteuid ();
714 saved_egid = getegid ();
715 break; 717 break;
716 case RESTORE: 718 case RESTORE:
719 setegid (saved_egid);
717 seteuid (saved_euid); 720 seteuid (saved_euid);
718 setegid (saved_egid);
719 break; 721 break;
720 } 722 }
721# else 723# else
722 switch (action) 724 switch (action)
723 { 725 {
724 case IGNORE: 726 case IGNORE:
727 setgid (getgid ());
725 setuid (getuid ()); 728 setuid (getuid ());
726 setgid (getgid ());
727 /* FALLTHROUGH */ 729 /* FALLTHROUGH */
728 case SAVE: 730 case SAVE:
729 /* FALLTHROUGH */ 731 /* FALLTHROUGH */
730 case RESTORE: 732 case RESTORE:
731 break; 733 break;
1447 unsigned long fg, bg; 1449 unsigned long fg, bg;
1448 const char *p; 1450 const char *p;
1449 char **s; 1451 char **s;
1450 XIMStyles *xim_styles; 1452 XIMStyles *xim_styles;
1451 1453
1452 TEMP_ENV; 1454 set_environ (envv);
1453 1455
1454 if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) 1456 if (! ((p = XSetLocaleModifiers (modifiers)) && *p))
1455 return false; 1457 return false;
1456 1458
1457 D_MAIN ((stderr, "rxvt_IM_get_IC ()")); 1459 D_MAIN ((stderr, "rxvt_IM_get_IC ()"));
1623 int i; 1625 int i;
1624 const char *p; 1626 const char *p;
1625 char **s; 1627 char **s;
1626 char buf[IMBUFSIZ]; 1628 char buf[IMBUFSIZ];
1627 1629
1628 SET_R (this); 1630 make_current ();
1629 1631
1630 im_destroy (); 1632 im_destroy ();
1631 1633
1632 D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()")); 1634 D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()"));
1633 if (Input_Context) 1635 if (Input_Context)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines