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.247 by ayin, Tue Jan 29 13:57:23 2008 UTC vs.
Revision 1.254 by root, Tue Nov 4 11:03:29 2008 UTC

459 459
460 /* no point having a scrollbar without having any scrollback! */ 460 /* no point having a scrollbar without having any scrollback! */
461 if (!saveLines) 461 if (!saveLines)
462 set_option (Opt_scrollBar, 0); 462 set_option (Opt_scrollBar, 0);
463 463
464#ifdef PRINTPIPE
465 if (!rs[Rs_print_pipe])
466 rs[Rs_print_pipe] = PRINTPIPE;
467#endif
468
469 if (!rs[Rs_cutchars]) 464 if (!rs[Rs_cutchars])
470 rs[Rs_cutchars] = CUTCHARS; 465 rs[Rs_cutchars] = CUTCHARS;
471 466
472#ifndef NO_BACKSPACE_KEY 467#ifndef NO_BACKSPACE_KEY
473 if (!rs[Rs_backspace_key]) 468 if (!rs[Rs_backspace_key])
485# else 480# else
486 rs[Rs_delete_key] = "\033[3~"; 481 rs[Rs_delete_key] = "\033[3~";
487# endif 482# endif
488#endif 483#endif
489 484
490 setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]); 485 scrollBar.setup (this);
491 486
492#ifdef XTERM_REVERSE_VIDEO 487#ifdef XTERM_REVERSE_VIDEO
493 /* this is how xterm implements reverseVideo */ 488 /* this is how xterm implements reverseVideo */
494 if (option (Opt_reverseVideo)) 489 if (option (Opt_reverseVideo))
495 { 490 {
539{ 534{
540 this->envv = envv; 535 this->envv = envv;
541 536
542 SET_R (this); 537 SET_R (this);
543 set_locale (""); 538 set_locale ("");
544 set_environ (envv); // few things in X do not call setlocale :( 539 set_environ (envv); // a few things in X do not call setlocale :(
545 540
546 init_vars (); 541 init_vars ();
547 542
548 init_secondary (); 543 init_secondary ();
549 544
551 546
552#ifdef KEYSYM_RESOURCE 547#ifdef KEYSYM_RESOURCE
553 keyboard->register_done (); 548 keyboard->register_done ();
554#endif 549#endif
555 550
551 if (const char *path = rs[Rs_chdir])
552 if (*path) // ignored if empty
553 {
554 if (*path != '/')
555 rxvt_fatal ("specified shell working directory must start with a slash, aborting.\n");
556
557 if (chdir (path))
558 rxvt_fatal ("unable to change into specified shell working directory, aborting.\n");
559 }
560
556 if (option (Opt_scrollBar)) 561 if (option (Opt_scrollBar))
557 scrollBar.state = STATE_IDLE; /* set existence for size calculations */ 562 scrollBar.state = STATE_IDLE; /* set existence for size calculations */
558 563
559 pty = ptytty::create (); 564 pty = ptytty::create ();
560 565
567#if 0 572#if 0
568 XSynchronize (dpy, True); 573 XSynchronize (dpy, True);
569#endif 574#endif
570 575
571 if (option (Opt_scrollBar)) 576 if (option (Opt_scrollBar))
572 resize_scrollbar (); /* create and map scrollbar */ 577 scrollBar.resize (); /* create and map scrollbar */
573#ifdef HAVE_BG_PIXMAP 578#ifdef HAVE_BG_PIXMAP
574 { 579 {
575 bgPixmap.set_target (this); 580 bgPixmap.set_target (this);
576 bgPixmap.invalidate (); 581 bgPixmap.invalidate ();
577 582
832 run_command (argv); 837 run_command (argv);
833} 838}
834 839
835/*----------------------------------------------------------------------*/ 840/*----------------------------------------------------------------------*/
836void 841void
837rxvt_term::Get_Colours () 842rxvt_term::get_colours ()
838{ 843{
839 int i; 844 int i;
840 845
841#ifdef OFF_FOCUS_FADING 846#ifdef OFF_FOCUS_FADING
842 pix_colors = pix_colors_focused; 847 pix_colors = pix_colors_focused;
1059 Window top, parent; 1064 Window top, parent;
1060 1065
1061 dLocal (Display *, dpy); 1066 dLocal (Display *, dpy);
1062 1067
1063 /* grab colors before netscape does */ 1068 /* grab colors before netscape does */
1064 Get_Colours (); 1069 get_colours ();
1065 1070
1066 if (!set_fonts ()) 1071 if (!set_fonts ())
1067 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n"); 1072 rxvt_fatal ("unable to load base fontset, please specify a valid one using -fn, aborting.\n");
1068 1073
1069 parent = display->root; 1074 parent = display->root;
1130 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState; 1135 wmHint.initial_state = option (Opt_iconic) ? IconicState : NormalState;
1131 wmHint.window_group = top; 1136 wmHint.window_group = top;
1132 1137
1133 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc, 1138 XmbSetWMProperties (dpy, top, NULL, NULL, (char **)argv, argc,
1134 &szHint, &wmHint, &classHint); 1139 &szHint, &wmHint, &classHint);
1140#if ENABLE_EWMH
1141# ifdef HAVE_AFTERIMAGE
1142 /*
1143 * set up icon hint
1144 * rs [Rs_iconfile] is path to icon, asv has been created in init_resources
1145 */
1146 if (rs [Rs_iconfile] && asv)
1147 {
1148 ASImage *im = file2ASImage (rs [Rs_iconfile], 0xFFFFFFFF, SCREEN_GAMMA, 0, NULL);
1149 if (im)
1150 {
1151 int w = im->width;
1152 int h = im->height;
1153 long* buffer = (long *)malloc ((2 + w * h) * sizeof (long));
1154 ASImage *result = scale_asimage (asv, im,
1155 w, h, ASA_ARGB32,
1156 100, ASIMAGE_QUALITY_DEFAULT);
1157 destroy_asimage (&im);
1158
1159 if (buffer && result)
1160 {
1161 ARGB32 *asbuf = result->alt.argb32;
1162 buffer [0] = w;
1163 buffer [1] = h;
1164
1165 for (unsigned int i = 0; i < w * h; ++i)
1166 buffer [i + 2] = asbuf [i];
1167
1168 destroy_asimage (&result);
1169 XChangeProperty (dpy, top, xa[XA_NET_WM_ICON], XA_CARDINAL, 32,
1170 PropModeReplace, (const unsigned char*) buffer, 2 + w * h);
1171 free (buffer);
1172 }
1173 else
1174 {
1175 if (!buffer)
1176 rxvt_warn ("Memory allocation for icon hint failed, continuing without.\n");
1177
1178 if (!result)
1179 rxvt_warn ("Icon image transformation to ARGB failed, continuing without.\n");
1180 }
1181 }
1182 else
1183 rxvt_warn ("Loading image icon failed, continuing without.\n");
1184 }
1185# endif
1186#endif
1135 1187
1136#if ENABLE_FRILLS 1188#if ENABLE_FRILLS
1137 if (mwmhints.flags) 1189 if (mwmhints.flags)
1138 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32, 1190 XChangeProperty (dpy, top, xa[XA_MOTIF_WM_HINTS], xa[XA_MOTIF_WM_HINTS], 32,
1139 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS); 1191 PropModeReplace, (unsigned char *)&mwmhints, PROP_MWM_HINTS_ELEMENTS);
1524 signal (SIGTSTP, SIG_IGN); 1576 signal (SIGTSTP, SIG_IGN);
1525 signal (SIGTTIN, SIG_IGN); 1577 signal (SIGTTIN, SIG_IGN);
1526 signal (SIGTTOU, SIG_IGN); 1578 signal (SIGTTOU, SIG_IGN);
1527#endif /* SIGTSTP */ 1579#endif /* SIGTSTP */
1528 1580
1529 // unblock signals (signals are blocked by iom.C
1530 sigset_t ss;
1531 sigemptyset (&ss);
1532 sigprocmask (SIG_SETMASK, &ss, 0);
1533
1534 /* command interpreter path */ 1581 /* command interpreter path */
1535 if (argv) 1582 if (argv)
1536 { 1583 {
1537# ifdef DEBUG_CMD 1584# ifdef DEBUG_CMD
1538 int i; 1585 int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines