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.65 by root, Fri Jul 30 16:13:46 2004 UTC vs.
Revision 1.68 by root, Tue Aug 10 20:39:19 2004 UTC

882 882
883#ifdef OFF_FOCUS_FADING 883#ifdef OFF_FOCUS_FADING
884 PixColors = PixColorsFocused; 884 PixColors = PixColorsFocused;
885#endif 885#endif
886 886
887 for (i = 0; i < (XDEPTH <= 2 ? 2 : NRS_COLORS); i++) 887 for (i = 0; i < (display->depth <= 2 ? 2 : NRS_COLORS); i++)
888 { 888 {
889 rxvt_color xcol; 889 rxvt_color xcol;
890 890
891 if (!rs[Rs_color + i]) 891 if (!rs[Rs_color + i])
892 continue; 892 continue;
934 PixColorsUnFocused[i] = xcol.fade (display, atoi (rs[Rs_fade])); 934 PixColorsUnFocused[i] = xcol.fade (display, atoi (rs[Rs_fade]));
935#endif 935#endif
936 SET_PIXCOLOR (i); 936 SET_PIXCOLOR (i);
937 } 937 }
938 938
939 if (XDEPTH <= 2) 939 if (display->depth <= 2)
940 { 940 {
941 if (!rs[Rs_color + Color_pointer_fg]) PixColors[Color_pointer_fg] = PixColors[Color_fg]; 941 if (!rs[Rs_color + Color_pointer_fg]) PixColors[Color_pointer_fg] = PixColors[Color_fg];
942 if (!rs[Rs_color + Color_pointer_bg]) PixColors[Color_pointer_bg] = PixColors[Color_bg]; 942 if (!rs[Rs_color + Color_pointer_bg]) PixColors[Color_pointer_bg] = PixColors[Color_bg];
943 if (!rs[Rs_color + Color_border] ) PixColors[Color_border] = PixColors[Color_fg]; 943 if (!rs[Rs_color + Color_border] ) PixColors[Color_border] = PixColors[Color_fg];
944 } 944 }
949 * The calculations of topShadow/bottomShadow values are adapted 949 * The calculations of topShadow/bottomShadow values are adapted
950 * from the fvwm window manager. 950 * from the fvwm window manager.
951 */ 951 */
952#ifdef KEEP_SCROLLCOLOR 952#ifdef KEEP_SCROLLCOLOR
953 953
954 if (XDEPTH <= 2) 954 if (display->depth <= 2)
955 { /* Monochrome */ 955 { /* Monochrome */
956 PixColors[Color_scroll] = PixColors[Color_fg]; 956 PixColors[Color_scroll] = PixColors[Color_fg];
957 PixColors[Color_topShadow] = PixColors[Color_bg]; 957 PixColors[Color_topShadow] = PixColors[Color_bg];
958 PixColors[Color_bottomShadow] = PixColors[Color_bg]; 958 PixColors[Color_bottomShadow] = PixColors[Color_bg];
959 } 959 }
1086void 1086void
1087rxvt_term::create_windows (int argc, const char *const *argv) 1087rxvt_term::create_windows (int argc, const char *const *argv)
1088{ 1088{
1089 XClassHint classHint; 1089 XClassHint classHint;
1090 XWMHints wmHint; 1090 XWMHints wmHint;
1091#ifndef NO_FRILLS
1092 Atom prop = None;
1093 MWMHints mwmhints;
1094#endif
1091 XGCValues gcvalue; 1095 XGCValues gcvalue;
1092 long vt_emask; 1096 long vt_emask;
1093 XSetWindowAttributes attributes; 1097 XSetWindowAttributes attributes;
1094 XWindowAttributes gattr; 1098 XWindowAttributes gattr;
1095 1099
1096 if (Options & Opt_transparent) 1100 if (Options & Opt_transparent)
1097 { 1101 {
1098 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); 1102 XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr);
1099 display->depth = gattr.depth; // doh //TODO, per-term not per-display? 1103 display->depth = gattr.depth; // doh //TODO, per-term not per-display?
1100 } 1104 }
1105
1106#ifndef NO_FRILLS
1107 if (Options & Opt_borderLess)
1108 {
1109 prop = XInternAtom(display->display, "_MOTIF_WM_INFO", True);
1110 if (prop == None)
1111 {
1112 /* print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.\n");*/
1113#ifdef PREFER_24BIT
1114 attributes.override_redirect = TRUE;
1115#endif
1116 mwmhints.flags = 0;
1117 }
1118 else
1119 {
1120 mwmhints.flags = MWM_HINTS_DECORATIONS;
1121 mwmhints.decorations = 0;
1122 }
1123 }
1124 else
1125 {
1126 mwmhints.flags = 0;
1127 }
1128#endif
1101 1129
1102 /* grab colors before netscape does */ 1130 /* grab colors before netscape does */
1103 Get_Colours (); 1131 Get_Colours ();
1104 1132
1105 if (!change_font (rs[Rs_font])) 1133 if (!change_font (rs[Rs_font]))
1160 KeyPressMask 1188 KeyPressMask
1161#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1189#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1162 | KeyReleaseMask 1190 | KeyReleaseMask
1163#endif 1191#endif
1164 | FocusChangeMask | VisibilityChangeMask 1192 | FocusChangeMask | VisibilityChangeMask
1193 | ExposureMask
1165 | StructureNotifyMask); 1194 | StructureNotifyMask);
1166 termwin_ev.start (display, TermWin.parent[0]); 1195 termwin_ev.start (display, TermWin.parent[0]);
1196
1197#ifndef NO_FRILLS
1198 if (mwmhints.flags)
1199 {
1200 prop = XInternAtom(display->display, "_MOTIF_WM_HINTS", False);
1201 XChangeProperty(display->display, TermWin.parent[0], prop, prop, 32, PropModeReplace, (unsigned char *) &mwmhints, PROP_MWM_HINTS_ELEMENTS);
1202 }
1203#endif
1167 1204
1168 /* vt cursor: Black-on-White is standard, but this is more popular */ 1205 /* vt cursor: Black-on-White is standard, but this is more popular */
1169 TermWin_cursor = XCreateFontCursor (display->display, XC_xterm); 1206 TermWin_cursor = XCreateFontCursor (display->display, XC_xterm);
1170 1207
1171#if defined(HAVE_SCROLLBARS) || defined(MENUBAR) 1208#if defined(HAVE_SCROLLBARS) || defined(MENUBAR)
1272#if defined(MENUBAR) || defined(RXVT_SCROLLBAR) 1309#if defined(MENUBAR) || defined(RXVT_SCROLLBAR)
1273 gcvalue.foreground = PixColors[Color_topShadow]; 1310 gcvalue.foreground = PixColors[Color_topShadow];
1274 topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); 1311 topShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue);
1275 gcvalue.foreground = PixColors[Color_bottomShadow]; 1312 gcvalue.foreground = PixColors[Color_bottomShadow];
1276 botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); 1313 botShadowGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue);
1277 gcvalue.foreground = PixColors[ (XDEPTH <= 2 ? Color_fg : Color_scroll)]; 1314 gcvalue.foreground = PixColors[ (display->depth <= 2 ? Color_fg : Color_scroll)];
1278 scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue); 1315 scrollbarGC = XCreateGC (display->display, TermWin.vt, GCForeground, &gcvalue);
1279#endif 1316#endif
1280 1317
1281#ifdef OFF_FOCUS_FADING 1318#ifdef OFF_FOCUS_FADING
1282 // initially we are in unfocused state 1319 // initially we are in unfocused state
1313 { 1350 {
1314 close (cfd); 1351 close (cfd);
1315 rxvt_fatal ("can't open slave tty %s", ttydev); 1352 rxvt_fatal ("can't open slave tty %s", ttydev);
1316 } 1353 }
1317 } 1354 }
1355
1318#ifndef NO_BACKSPACE_KEY 1356#ifndef NO_BACKSPACE_KEY
1319 if (key_backspace[0] && !key_backspace[1]) 1357 if (key_backspace[0] && !key_backspace[1])
1320 er = key_backspace[0]; 1358 er = key_backspace[0];
1321 else if (STRCMP (key_backspace, "DEC") == 0) 1359 else if (STRCMP (key_backspace, "DEC") == 0)
1322 er = '\177'; /* the initial state anyway */ 1360 er = '\177'; /* the initial state anyway */
1323 else 1361 else
1324#endif 1362#endif
1325
1326 er = -1; 1363 er = -1;
1327 1364
1328 rxvt_get_ttymode (& (tio), er); 1365 rxvt_get_ttymode (&tio, er);
1329 1366
1330#ifndef __QNX__ 1367#ifndef __QNX__
1331 /* spin off the command interpreter */ 1368 /* spin off the command interpreter */
1332 switch (cmd_pid = fork ()) 1369 switch (cmd_pid = fork ())
1333 { 1370 {
1414#elif defined (SRIOCSREDIR) 1451#elif defined (SRIOCSREDIR)
1415 int fd; 1452 int fd;
1416 1453
1417 fd = open (CONSOLE, O_WRONLY, 0); 1454 fd = open (CONSOLE, O_WRONLY, 0);
1418 if (fd >= 0) 1455 if (fd >= 0)
1419 {
1420 if (ioctl (fd, SRIOCSREDIR, NULL) < 0) 1456 if (ioctl (fd, SRIOCSREDIR, NULL) < 0)
1421 close (fd); 1457 close (fd);
1422 }
1423#endif /* SRIOCSREDIR */ 1458#endif /* SRIOCSREDIR */
1424 1459
1425 } 1460 }
1426 1461
1427 /* reset signals and spin off the command interpreter */ 1462 /* reset signals and spin off the command interpreter */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines