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.45 by pcg, Mon Mar 22 17:18:25 2004 UTC vs.
Revision 1.51 by pcg, Sun May 9 18:19:49 2004 UTC

1/*--------------------------------*-C-*---------------------------------* 1/*--------------------------------*-C-*---------------------------------*
2 * File: init.c 2 * File: init.C
3 *----------------------------------------------------------------------* 3 *----------------------------------------------------------------------*
4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk> 6 * Copyright (c) 1992 John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
7 * - original version 7 * - original version
313#endif 313#endif
314#ifndef NO_CURSORCOLOR 314#ifndef NO_CURSORCOLOR
315 COLOR_CURSOR_BACKGROUND, 315 COLOR_CURSOR_BACKGROUND,
316 COLOR_CURSOR_FOREGROUND, 316 COLOR_CURSOR_FOREGROUND,
317#endif /* ! NO_CURSORCOLOR */ 317#endif /* ! NO_CURSORCOLOR */
318 NULL, /* Color_pointer */ 318 NULL, /* Color_pointer_fg */
319 NULL, /* Color_pointer_bg */
319 NULL, /* Color_border */ 320 NULL, /* Color_border */
320#ifndef NO_BOLD_UNDERLINE_REVERSE 321#ifndef NO_BOLD_UNDERLINE_REVERSE
321 NULL, /* Color_BD */ 322 NULL, /* Color_BD */
322 NULL, /* Color_UL */ 323 NULL, /* Color_UL */
323 NULL, /* Color_RV */ 324 NULL, /* Color_RV */
324#endif /* ! NO_BOLD_UNDERLINE_REVERSE */ 325#endif /* ! NO_BOLD_UNDERLINE_REVERSE */
325#ifdef OPTION_HC 326#ifdef OPTION_HC
327 NULL,
328#endif
329#if TINTING
326 NULL, 330 NULL,
327#endif 331#endif
328#ifdef KEEP_SCROLLCOLOR 332#ifdef KEEP_SCROLLCOLOR
329 COLOR_SCROLLBAR, 333 COLOR_SCROLLBAR,
330 COLOR_SCROLLTROUGH, 334 COLOR_SCROLLTROUGH,
644 color_aliases (Color_bg); 648 color_aliases (Color_bg);
645#ifndef NO_CURSORCOLOR 649#ifndef NO_CURSORCOLOR
646 color_aliases (Color_cursor); 650 color_aliases (Color_cursor);
647 color_aliases (Color_cursor2); 651 color_aliases (Color_cursor2);
648#endif /* NO_CURSORCOLOR */ 652#endif /* NO_CURSORCOLOR */
649 color_aliases (Color_pointer); 653 color_aliases (Color_pointer_fg);
654 color_aliases (Color_pointer_bg);
650 color_aliases (Color_border); 655 color_aliases (Color_border);
651#ifndef NO_BOLD_UNDERLINE_REVERSE 656#ifndef NO_BOLD_UNDERLINE_REVERSE
652 color_aliases (Color_BD); 657 color_aliases (Color_BD);
653 color_aliases (Color_UL); 658 color_aliases (Color_UL);
654 color_aliases (Color_RV); 659 color_aliases (Color_RV);
894#ifndef NO_CURSORCOLOR 899#ifndef NO_CURSORCOLOR
895 case Color_cursor2: 900 case Color_cursor2:
896 xcol = PixColors[Color_fg]; 901 xcol = PixColors[Color_fg];
897 break; 902 break;
898#endif /* ! NO_CURSORCOLOR */ 903#endif /* ! NO_CURSORCOLOR */
899 case Color_pointer: 904 case Color_pointer_fg:
900 xcol = PixColors[Color_fg]; 905 xcol = PixColors[Color_fg];
901 break; 906 break;
902 default: 907 default:
903 xcol = PixColors[Color_bg]; /* None */ 908 xcol = PixColors[Color_bg]; /* None */
904 break; 909 break;
908 913
909 PixColors[i] = xcol; 914 PixColors[i] = xcol;
910 SET_PIXCOLOR (i); 915 SET_PIXCOLOR (i);
911 } 916 }
912 917
913 if (XDEPTH <= 2 || !rs[Rs_color + Color_pointer]) 918 if (XDEPTH <= 2)
914 PixColors[Color_pointer] = PixColors[Color_fg]; 919 {
915 if (XDEPTH <= 2 || !rs[Rs_color + Color_border]) 920 if (!rs[Rs_color + Color_pointer_fg]) PixColors[Color_pointer_fg] = PixColors[Color_fg];
916 PixColors[Color_border] = PixColors[Color_fg]; 921 if (!rs[Rs_color + Color_pointer_bg]) PixColors[Color_pointer_bg] = PixColors[Color_bg];
922 if (!rs[Rs_color + Color_border] ) PixColors[Color_border] = PixColors[Color_fg];
923 }
917 924
918 /* 925 /*
919 * get scrollBar/menuBar shadow colors 926 * get scrollBar/menuBar shadow colors
920 * 927 *
921 * The calculations of topShadow/bottomShadow values are adapted 928 * The calculations of topShadow/bottomShadow values are adapted
1065/*----------------------------------------------------------------------*/ 1072/*----------------------------------------------------------------------*/
1066/* rxvt_Create_Windows () - Open and map the window */ 1073/* rxvt_Create_Windows () - Open and map the window */
1067void 1074void
1068rxvt_term::create_windows (int argc, const char *const *argv) 1075rxvt_term::create_windows (int argc, const char *const *argv)
1069{ 1076{
1070 XClassHint classHint; 1077 XClassHint classHint;
1071 XWMHints wmHint; 1078 XWMHints wmHint;
1072 XGCValues gcvalue; 1079 XGCValues gcvalue;
1073 long vt_emask; 1080 long vt_emask;
1074 1081 XSetWindowAttributes attributes;
1075 XWindowAttributes gattr; 1082 XWindowAttributes gattr;
1076 1083
1077 if (Options & Opt_transparent) 1084 if (Options & Opt_transparent)
1078 { 1085 {
1079 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); 1086 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr);
1092 1099
1093 window_calc (0, 0); 1100 window_calc (0, 0);
1094 old_width = szHint.width; 1101 old_width = szHint.width;
1095 old_height = szHint.height; 1102 old_height = szHint.height;
1096 1103
1097 /* parent window - reverse video so we can see placement errors
1098 * sub-window placement & size in rxvt_resize_subwindows () 1104 /* sub-window placement & size in rxvt_resize_subwindows () */
1099 */
1100 1105
1101#ifdef PREFER_24BIT 1106#ifdef PREFER_24BIT
1102 XSetWindowAttributes attributes;
1103
1104 attributes.background_pixel = PixColors[Color_fg]; 1107 attributes.background_pixel = PixColors[Color_bg];
1105 attributes.border_pixel = PixColors[Color_border]; 1108 attributes.border_pixel = PixColors[Color_border];
1106 attributes.colormap = display->cmap; 1109 attributes.colormap = display->cmap;
1107 TermWin.parent[0] = XCreateWindow (display->display, DefaultRootWindow (display->display), 1110 TermWin.parent[0] = XCreateWindow (display->display, DefaultRootWindow (display->display),
1108 szHint.x, szHint.y, 1111 szHint.x, szHint.y,
1109 szHint.width, szHint.height, 1112 szHint.width, szHint.height,
1110 TermWin.ext_bwidth, 1113 TermWin.ext_bwidth,
1111 display->depth, InputOutput, 1114 display->depth, InputOutput,
1112 display->visual, 1115 display->visual,
1113 CWBackPixel | CWBorderPixel | CWColormap, &attributes); 1116 CWColormap | CWBackPixel | CWBorderPixel, &attributes);
1114#else 1117#else
1115 TermWin.parent[0] = XCreateSimpleWindow (display->display, DefaultRootWindow (display->display), 1118 TermWin.parent[0] = XCreateSimpleWindow (display->display, DefaultRootWindow (display->display),
1116 szHint.x, szHint.y, 1119 szHint.x, szHint.y,
1117 szHint.width, 1120 szHint.width, szHint.height,
1118 szHint.height,
1119 TermWin.ext_bwidth, 1121 TermWin.ext_bwidth,
1120 PixColors[Color_border], 1122 PixColors[Color_border],
1121 PixColors[Color_fg]); 1123 PixColors[Color_bg]);
1122#endif 1124#endif
1123 1125
1124 xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); 1126 process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST);
1125 xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); 1127 process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST);
1126 1128
1127 classHint.res_name = (char *)rs[Rs_name]; 1129 classHint.res_name = (char *)rs[Rs_name];
1128 classHint.res_class = (char *)RESCLASS; 1130 classHint.res_class = (char *)RESCLASS;
1129 1131
1130 wmHint.flags = (InputHint | StateHint | WindowGroupHint); 1132 wmHint.flags = InputHint | StateHint | WindowGroupHint;
1131 wmHint.input = True; 1133 wmHint.input = True;
1132 wmHint.initial_state = (Options & Opt_iconic ? IconicState 1134 wmHint.initial_state = Options & Opt_iconic ? IconicState : NormalState;
1133 : NormalState);
1134 wmHint.window_group = TermWin.parent[0]; 1135 wmHint.window_group = TermWin.parent[0];
1135 1136
1136 XSetWMProperties (display->display, TermWin.parent[0], NULL, NULL, 1137 XSetWMProperties (display->display, TermWin.parent[0], NULL, NULL,
1137 (char **)argv, argc, &szHint, &wmHint, &classHint); 1138 (char **)argv, argc, &szHint, &wmHint, &classHint);
1139
1140#ifndef NO_FRILLS
1141 long pid = getpid ();
1142 XChangeProperty (display->display, TermWin.parent[0],
1143 display->atom ("_NET_WM_PID"), XA_CARDINAL, 32,
1144 PropModeReplace, (unsigned char *)&pid, 1);
1145#endif
1138 1146
1139 XSelectInput (display->display, TermWin.parent[0], 1147 XSelectInput (display->display, TermWin.parent[0],
1140 KeyPressMask 1148 KeyPressMask
1141#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1149#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1142 | KeyReleaseMask 1150 | KeyReleaseMask
1177 1185
1178#ifdef DEBUG_X 1186#ifdef DEBUG_X
1179 XStoreName (display->display, TermWin.vt, "vt window"); 1187 XStoreName (display->display, TermWin.vt, "vt window");
1180#endif 1188#endif
1181 1189
1190 attributes.bit_gravity = NorthWestGravity;
1191 XChangeWindowAttributes (display->display, TermWin.vt, CWBitGravity, &attributes);
1192
1182 vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask 1193 vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
1183 | PropertyChangeMask);
1184 1194
1185#ifdef POINTER_BLANK 1195#ifdef POINTER_BLANK
1186 pointer_unblank (); 1196 pointer_unblank ();
1187 1197
1188 if ((Options & Opt_pointerBlank)) 1198 if (Options & Opt_pointerBlank)
1189 vt_emask |= PointerMotionMask; 1199 vt_emask |= PointerMotionMask;
1190 else 1200 else
1191#endif 1201#endif
1192 vt_emask |= (Button1MotionMask | Button3MotionMask); 1202 vt_emask |= Button1MotionMask | Button3MotionMask;
1193 1203
1194 XSelectInput (display->display, TermWin.vt, vt_emask); 1204 XSelectInput (display->display, TermWin.vt, vt_emask);
1195 vt_ev.start (display, TermWin.vt); 1205 vt_ev.start (display, TermWin.vt);
1196 1206
1197#if defined(MENUBAR) && (MENUBAR_MAX > 1) 1207#if defined(MENUBAR) && (MENUBAR_MAX > 1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines