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

Comparing rxvt-unicode/src/init.C (file contents):
Revision 1.133 by root, Fri Jan 6 05:28:55 2006 UTC vs.
Revision 1.142 by root, Fri Jan 13 04:59:04 2006 UTC

9 * - extensive modifications 9 * - extensive modifications
10 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 10 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
11 * - extensive modifications 11 * - extensive modifications
12 * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com> 12 * Copyright (c) 1999 D J Hawkey Jr <hawkeyd@visi.com>
13 * - QNX support 13 * - QNX support
14 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> 14 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com>
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by 17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or 18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version. 19 * (at your option) any later version.
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
344 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) 345 if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL)
345 rs[Rs_display_name] = ":0"; 346 rs[Rs_display_name] = ":0";
346 347
347 get_options (r_argc, r_argv); 348 get_options (r_argc, r_argv);
348 349
349 if (!(display = displays.get (rs[Rs_display_name]))) 350 if (!(display = displays.get (rs[Rs_display_name])))
350 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]);
351 352
352 extract_resources (); 353 extract_resources ();
354
353 free (r_argv); 355 free (r_argv);
354 356
355 /* 357 /*
356 * set any defaults not already set 358 * set any defaults not already set
357 */ 359 */
391 pointerBlankDelay = 2; 393 pointerBlankDelay = 2;
392#endif 394#endif
393 395
394 /* no point having a scrollbar without having any scrollback! */ 396 /* no point having a scrollbar without having any scrollback! */
395 if (!saveLines) 397 if (!saveLines)
396 CLR_OPTION (Opt_scrollBar); 398 set_option (Opt_scrollBar, 0);
397 399
398#ifdef PRINTPIPE 400#ifdef PRINTPIPE
399 if (!rs[Rs_print_pipe]) 401 if (!rs[Rs_print_pipe])
400 rs[Rs_print_pipe] = PRINTPIPE; 402 rs[Rs_print_pipe] = PRINTPIPE;
401#endif 403#endif
576 * This should support all European type languages. 578 * This should support all European type languages.
577 */ 579 */
578void 580void
579rxvt_term::set_locale (const char *locale) 581rxvt_term::set_locale (const char *locale)
580{ 582{
583 set_environ (envv);
584
581#if HAVE_XSETLOCALE || HAVE_SETLOCALE 585#if HAVE_XSETLOCALE || HAVE_SETLOCALE
582 free (this->locale); 586 free (this->locale);
583 this->locale = setlocale (LC_CTYPE, locale); 587 this->locale = setlocale (LC_CTYPE, locale);
584 588
585 if (!this->locale) 589 if (!this->locale)
586 { 590 {
587 if (*locale) 591 if (*locale)
588 { 592 {
589 rxvt_warn ("unable to set locale \"%s\", using default locale instead.\n", locale); 593 rxvt_warn ("unable to set locale \"%s\", using C locale instead.\n", locale);
590 setlocale (LC_CTYPE, ""); 594 setlocale (LC_CTYPE, "C");
591 } 595 }
592 else 596 else
593 rxvt_warn ("default locale unavailable, check LC_* and LANG variables. Continuing.\n"); 597 rxvt_warn ("default locale unavailable, check LC_* and LANG variables. Continuing.\n");
594 598
595 this->locale = ""; 599 this->locale = "C";
596 } 600 }
597 601
598 602
599 this->locale = rxvt_strdup (this->locale); 603 this->locale = rxvt_strdup (this->locale);
600 SET_LOCALE (this->locale); 604 SET_LOCALE (this->locale);
615} 619}
616 620
617void 621void
618rxvt_term::init_xlocale () 622rxvt_term::init_xlocale ()
619{ 623{
624 set_environ (envv);
625
620#ifdef USE_XIM 626#ifdef USE_XIM
621 if (!locale) 627 if (!locale)
622 rxvt_warn ("setting locale failed, working without locale support.\n"); 628 rxvt_warn ("setting locale failed, working without locale support.\n");
623 else 629 else
624 { 630 {
916#if ENABLE_FRILLS 922#if ENABLE_FRILLS
917 Atom prop = None; 923 Atom prop = None;
918 MWMHints mwmhints; 924 MWMHints mwmhints;
919#endif 925#endif
920 XGCValues gcvalue; 926 XGCValues gcvalue;
921 long vt_emask;
922 XSetWindowAttributes attributes; 927 XSetWindowAttributes attributes;
923 XWindowAttributes gattr; 928 XWindowAttributes gattr;
924 Window top, parent; 929 Window top, parent;
925 dDisp; 930 dDisp;
926 931
1089 attributes.bit_gravity = NorthWestGravity; 1094 attributes.bit_gravity = NorthWestGravity;
1090 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes); 1095 XChangeWindowAttributes (disp, vt, CWBitGravity, &attributes);
1091 1096
1092 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; 1097 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1093 1098
1094 if (OPTION (Opt_pointerBlank) 1099 if (OPTION (Opt_pointerBlank))
1095#ifdef ENABLE_PERL
1096 || self
1097#endif
1098 )
1099 vt_emask |= PointerMotionMask; 1100 vt_emask |= PointerMotionMask;
1100 else 1101 else
1101 vt_emask |= Button1MotionMask | Button3MotionMask; 1102 vt_emask |= Button1MotionMask | Button3MotionMask;
1102 1103
1103 XSelectInput (disp, vt, vt_emask); 1104 vt_select_input ();
1105
1104 vt_ev.start (display, vt); 1106 vt_ev.start (display, vt);
1105 1107
1106#if defined(MENUBAR) && (MENUBAR_MAX > 1) 1108#if defined(MENUBAR) && (MENUBAR_MAX > 1)
1107 if (menuBar_height ()) 1109 if (menuBar_height ())
1108 { 1110 {
1580 execvp (argv[0], (char *const *)argv); 1582 execvp (argv[0], (char *const *)argv);
1581 /* no error message: STDERR is closed! */ 1583 /* no error message: STDERR is closed! */
1582 } 1584 }
1583 else 1585 else
1584 { 1586 {
1585 const char *argv0, *shell; 1587 const char *argv0, *shell;
1586 1588
1587 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') 1589 if ((shell = getenv ("SHELL")) == NULL || *shell == '\0')
1588 shell = "/bin/sh"; 1590 shell = "/bin/sh";
1589 1591
1590 argv0 = (const char *)rxvt_r_basename (shell); 1592 argv0 = (const char *)rxvt_r_basename (shell);
1595 1597
1596 login[0] = '-'; 1598 login[0] = '-';
1597 strcpy (&login[1], argv0); 1599 strcpy (&login[1], argv0);
1598 argv0 = login; 1600 argv0 = login;
1599 } 1601 }
1602
1600 execlp (shell, argv0, NULL); 1603 execlp (shell, argv0, NULL);
1601 /* no error message: STDERR is closed! */ 1604 /* no error message: STDERR is closed! */
1602 } 1605 }
1603 1606
1604#else /* __QNX__ uses qnxspawn () */ 1607#else /* __QNX__ uses qnxspawn () */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines