… | |
… | |
339 | rs[Rs_name] = rxvt_r_basename (argv[0]); |
339 | rs[Rs_name] = rxvt_r_basename (argv[0]); |
340 | |
340 | |
341 | /* |
341 | /* |
342 | * Open display, get options/resources and create the window |
342 | * Open display, get options/resources and create the window |
343 | */ |
343 | */ |
344 | { |
|
|
345 | TEMP_ENV; |
|
|
346 | |
344 | |
347 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
345 | if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) |
348 | rs[Rs_display_name] = ":0"; |
346 | rs[Rs_display_name] = ":0"; |
349 | |
347 | |
350 | get_options (r_argc, r_argv); |
348 | get_options (r_argc, r_argv); |
351 | |
349 | |
352 | if (!(display = displays.get (rs[Rs_display_name]))) |
350 | if (!(display = displays.get (rs[Rs_display_name]))) |
353 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
351 | rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); |
354 | } |
|
|
355 | |
352 | |
356 | extract_resources (); |
353 | extract_resources (); |
|
|
354 | |
357 | free (r_argv); |
355 | free (r_argv); |
358 | |
356 | |
359 | /* |
357 | /* |
360 | * set any defaults not already set |
358 | * set any defaults not already set |
361 | */ |
359 | */ |
… | |
… | |
580 | * This should support all European type languages. |
578 | * This should support all European type languages. |
581 | */ |
579 | */ |
582 | void |
580 | void |
583 | rxvt_term::set_locale (const char *locale) |
581 | rxvt_term::set_locale (const char *locale) |
584 | { |
582 | { |
585 | TEMP_ENV; |
583 | set_environ (envv); |
586 | |
584 | |
587 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
585 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
588 | free (this->locale); |
586 | free (this->locale); |
589 | this->locale = setlocale (LC_CTYPE, locale); |
587 | this->locale = setlocale (LC_CTYPE, locale); |
590 | |
588 | |
… | |
… | |
621 | } |
619 | } |
622 | |
620 | |
623 | void |
621 | void |
624 | rxvt_term::init_xlocale () |
622 | rxvt_term::init_xlocale () |
625 | { |
623 | { |
626 | TEMP_ENV; |
624 | set_environ (envv); |
627 | |
625 | |
628 | #ifdef USE_XIM |
626 | #ifdef USE_XIM |
629 | if (!locale) |
627 | if (!locale) |
630 | rxvt_warn ("setting locale failed, working without locale support.\n"); |
628 | rxvt_warn ("setting locale failed, working without locale support.\n"); |
631 | else |
629 | else |
… | |
… | |
924 | #if ENABLE_FRILLS |
922 | #if ENABLE_FRILLS |
925 | Atom prop = None; |
923 | Atom prop = None; |
926 | MWMHints mwmhints; |
924 | MWMHints mwmhints; |
927 | #endif |
925 | #endif |
928 | XGCValues gcvalue; |
926 | XGCValues gcvalue; |
929 | long vt_emask; |
|
|
930 | XSetWindowAttributes attributes; |
927 | XSetWindowAttributes attributes; |
931 | XWindowAttributes gattr; |
928 | XWindowAttributes gattr; |
932 | Window top, parent; |
929 | Window top, parent; |
933 | dDisp; |
930 | dDisp; |
934 | |
931 | |
… | |
… | |
1097 | attributes.bit_gravity = NorthWestGravity; |
1094 | attributes.bit_gravity = NorthWestGravity; |
1098 | XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); |
1095 | XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); |
1099 | |
1096 | |
1100 | vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; |
1097 | vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; |
1101 | |
1098 | |
1102 | if (OPTION (Opt_pointerBlank) |
1099 | if (OPTION (Opt_pointerBlank)) |
1103 | #ifdef ENABLE_PERL |
|
|
1104 | || perl.self |
|
|
1105 | #endif |
|
|
1106 | ) |
|
|
1107 | vt_emask |= PointerMotionMask; |
1100 | vt_emask |= PointerMotionMask; |
1108 | else |
1101 | else |
1109 | vt_emask |= Button1MotionMask | Button3MotionMask; |
1102 | vt_emask |= Button1MotionMask | Button3MotionMask; |
1110 | |
1103 | |
1111 | XSelectInput (disp, vt, vt_emask); |
1104 | vt_select_input (); |
|
|
1105 | |
1112 | vt_ev.start (display, vt); |
1106 | vt_ev.start (display, vt); |
1113 | |
1107 | |
1114 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1108 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1115 | if (menuBar_height ()) |
1109 | if (menuBar_height ()) |
1116 | { |
1110 | { |
… | |
… | |
1532 | */ |
1526 | */ |
1533 | int |
1527 | int |
1534 | rxvt_term::run_child (const char *const *argv) |
1528 | rxvt_term::run_child (const char *const *argv) |
1535 | { |
1529 | { |
1536 | char *login; |
1530 | char *login; |
1537 | |
|
|
1538 | TEMP_ENV; // not very temporary... |
|
|
1539 | |
1531 | |
1540 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
1532 | SET_TTYMODE (STDIN_FILENO, &tio); /* init terminal attributes */ |
1541 | |
1533 | |
1542 | if (OPTION (Opt_console)) |
1534 | if (OPTION (Opt_console)) |
1543 | { /* be virtual console, fail silently */ |
1535 | { /* be virtual console, fail silently */ |