… | |
… | |
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 | |
|
|
484 | const char **cmd_argv; |
|
|
485 | |
|
|
486 | { |
483 | TEMP_ENV; // few things in X do not call setlocale :( |
487 | TEMP_ENV; // few things in X do not call setlocale :( |
484 | |
488 | |
485 | set_locale (""); |
489 | set_locale (""); |
486 | |
490 | |
487 | if (!init_vars ()) |
491 | if (!init_vars ()) |
488 | return false; |
492 | return false; |
489 | |
493 | |
490 | init_secondary (); |
494 | init_secondary (); |
491 | |
495 | |
492 | const char **cmd_argv = init_resources (argc, argv); |
496 | cmd_argv = init_resources (argc, argv); |
493 | |
497 | |
494 | #ifdef KEYSYM_RESOURCE |
498 | #ifdef KEYSYM_RESOURCE |
495 | keyboard->register_done (); |
499 | keyboard->register_done (); |
496 | #endif |
500 | #endif |
497 | |
501 | |
498 | #if MENUBAR_MAX |
502 | #if MENUBAR_MAX |
499 | menubar_read (rs[Rs_menu]); |
503 | menubar_read (rs[Rs_menu]); |
500 | #endif |
504 | #endif |
501 | #ifdef HAVE_SCROLLBARS |
505 | #ifdef HAVE_SCROLLBARS |
502 | if (OPTION (Opt_scrollBar)) |
506 | if (OPTION (Opt_scrollBar)) |
503 | scrollBar.setIdle (); /* set existence for size calculations */ |
507 | scrollBar.setIdle (); /* set existence for size calculations */ |
504 | #endif |
508 | #endif |
|
|
509 | } |
505 | |
510 | |
506 | #if ENABLE_PERL |
511 | #if ENABLE_PERL |
507 | if (!rs[Rs_perl_ext_1]) |
512 | if (!rs[Rs_perl_ext_1]) |
508 | rs[Rs_perl_ext_1] = "default"; |
513 | rs[Rs_perl_ext_1] = "default"; |
509 | |
514 | |
… | |
… | |
523 | rs[Rs_perl_eval] = 0; |
528 | rs[Rs_perl_eval] = 0; |
524 | } |
529 | } |
525 | } |
530 | } |
526 | #endif |
531 | #endif |
527 | rxvt_perl.init (); |
532 | rxvt_perl.init (); |
|
|
533 | setlocale (LC_CTYPE, curlocale); // perl destroys this info |
528 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
534 | HOOK_INVOKE ((this, HOOK_INIT, DT_END)); |
529 | } |
535 | } |
530 | #endif |
536 | #endif |
531 | |
537 | |
|
|
538 | { |
|
|
539 | TEMP_ENV; |
|
|
540 | |
532 | create_windows (argc, argv); |
541 | create_windows (argc, argv); |
533 | |
542 | |
534 | dDisp; |
543 | dDisp; |
535 | |
544 | |
536 | init_xlocale (); |
545 | init_xlocale (); |
537 | |
546 | |
538 | scr_reset (); // initialize screen |
547 | scr_reset (); // initialize screen |
539 | |
548 | |
540 | #if 0 |
549 | #if 0 |
541 | XSynchronize (disp, True); |
550 | XSynchronize (disp, True); |
542 | #endif |
551 | #endif |
543 | |
552 | |
544 | #ifdef HAVE_SCROLLBARS |
553 | #ifdef HAVE_SCROLLBARS |
545 | if (OPTION (Opt_scrollBar)) |
554 | if (OPTION (Opt_scrollBar)) |
546 | resize_scrollbar (); /* create and map scrollbar */ |
555 | resize_scrollbar (); /* create and map scrollbar */ |
547 | #endif |
556 | #endif |
548 | #if (MENUBAR_MAX) |
557 | #if (MENUBAR_MAX) |
549 | if (menubar_visible ()) |
558 | if (menubar_visible ()) |
550 | XMapWindow (disp, menuBar.win); |
559 | XMapWindow (disp, menuBar.win); |
551 | #endif |
560 | #endif |
552 | #ifdef TRANSPARENT |
561 | #ifdef TRANSPARENT |
553 | if (OPTION (Opt_transparent)) |
562 | if (OPTION (Opt_transparent)) |
554 | { |
563 | { |
555 | XSelectInput (disp, display->root, PropertyChangeMask); |
564 | XSelectInput (disp, display->root, PropertyChangeMask); |
556 | check_our_parents (); |
565 | check_our_parents (); |
557 | rootwin_ev.start (display, display->root); |
566 | rootwin_ev.start (display, display->root); |
558 | } |
567 | } |
559 | #endif |
568 | #endif |
560 | |
569 | |
561 | XMapWindow (disp, vt); |
570 | XMapWindow (disp, vt); |
562 | XMapWindow (disp, parent[0]); |
571 | XMapWindow (disp, parent[0]); |
563 | |
572 | |
564 | set_colorfgbg (); |
573 | set_colorfgbg (); |
565 | |
574 | |
566 | init_command (cmd_argv); |
575 | init_command (cmd_argv); |
567 | |
576 | |
568 | free (cmd_argv); |
577 | free (cmd_argv); |
569 | |
578 | |
570 | if (pty.pty >= 0) |
579 | if (pty.pty >= 0) |
571 | pty_ev.start (pty.pty, EVENT_READ); |
580 | pty_ev.start (pty.pty, EVENT_READ); |
572 | |
581 | |
573 | check_ev.start (); |
582 | check_ev.start (); |
574 | |
583 | |
575 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
584 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
|
|
585 | } |
576 | |
586 | |
577 | return true; |
587 | return true; |
578 | } |
588 | } |
579 | |
589 | |
580 | static struct sig_handlers |
590 | static struct sig_handlers |