1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.9 2003/12/02 21:49:46 pcg Exp $ |
4 | * $Id: init.C,v 1.12 2003/12/18 00:29:29 pcg Exp $ |
5 | * |
5 | * |
6 | * All portions of code are copyright by their respective author/s. |
6 | * All portions of code are copyright by their respective author/s. |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
7 | * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> |
8 | * - original version |
8 | * - original version |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
9 | * Copyright (c) 1994 Robert Nation <nation@rocket.sanders.lockheed.com> |
… | |
… | |
357 | PixColors = new rxvt_color [TOTAL_COLORS]; |
357 | PixColors = new rxvt_color [TOTAL_COLORS]; |
358 | if (PixColors == NULL) |
358 | if (PixColors == NULL) |
359 | return false; |
359 | return false; |
360 | |
360 | |
361 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
361 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
362 | |
|
|
363 | TermWin.pixmap = None; |
362 | TermWin.pixmap = None; |
364 | #endif |
363 | #endif |
365 | #ifdef UTMP_SUPPORT |
364 | #ifdef UTMP_SUPPORT |
366 | |
|
|
367 | next_utmp_action = SAVE; |
365 | next_utmp_action = SAVE; |
368 | #endif |
366 | #endif |
369 | #ifndef NO_SETOWNER_TTYDEV |
367 | #ifndef NO_SETOWNER_TTYDEV |
370 | |
|
|
371 | next_tty_action = SAVE; |
368 | next_tty_action = SAVE; |
372 | #endif |
369 | #endif |
373 | |
370 | |
374 | MEvent.time = CurrentTime; |
371 | MEvent.time = CurrentTime; |
375 | MEvent.button = AnyButton; |
372 | MEvent.button = AnyButton; |
… | |
… | |
458 | R->ttymode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; |
455 | R->ttymode = S_IRUSR | S_IWUSR | S_IWGRP | S_IWOTH; |
459 | R->ttygid = getgid (); |
456 | R->ttygid = getgid (); |
460 | } |
457 | } |
461 | |
458 | |
462 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
459 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
463 | R->locale = setlocale (LC_CTYPE, ""); |
460 | R->locale = strdup (setlocale (LC_CTYPE, "")); |
464 | #endif |
461 | #endif |
465 | |
462 | |
466 | /* |
463 | /* |
467 | * Close all unused file descriptors |
464 | * Close all unused file descriptors |
468 | * We don't want them, we don't need them. |
465 | * We don't want them, we don't need them. |
… | |
… | |
823 | #ifdef USE_XIM |
820 | #ifdef USE_XIM |
824 | if (R->locale == NULL) |
821 | if (R->locale == NULL) |
825 | rxvt_print_error("Setting locale failed."); |
822 | rxvt_print_error("Setting locale failed."); |
826 | else |
823 | else |
827 | { |
824 | { |
828 | Atom wmlocale; |
825 | Atom wmlocale; |
829 | |
826 | |
830 | wmlocale = XInternAtom(R->Xdisplay, "WM_LOCALE_NAME", False); |
827 | wmlocale = XInternAtom(R->Xdisplay, "WM_LOCALE_NAME", False); |
831 | XChangeProperty(R->Xdisplay, R->TermWin.parent[0], wmlocale, |
828 | XChangeProperty(R->Xdisplay, R->TermWin.parent[0], wmlocale, |
832 | XA_STRING, 8, PropModeReplace, |
829 | XA_STRING, 8, PropModeReplace, |
833 | (unsigned char *)R->locale, STRLEN(R->locale)); |
830 | (unsigned char *)R->locale, STRLEN(R->locale)); |
… | |
… | |
835 | if (XSupportsLocale() != True) |
832 | if (XSupportsLocale() != True) |
836 | { |
833 | { |
837 | rxvt_print_error("The locale is not supported by Xlib"); |
834 | rxvt_print_error("The locale is not supported by Xlib"); |
838 | return; |
835 | return; |
839 | } |
836 | } |
|
|
837 | |
840 | rxvt_setTermFontSet(aR_ 0); |
838 | rxvt_setTermFontSet(aR_ 0); |
841 | |
839 | |
842 | /* see if we can connect yet */ |
840 | /* see if we can connect yet */ |
843 | rxvt_IMInstantiateCallback(R->Xdisplay, NULL, NULL); |
841 | rxvt_IMInstantiateCallback(R->Xdisplay, NULL, NULL); |
844 | |
842 | |