… | |
… | |
1072 | /*----------------------------------------------------------------------*/ |
1072 | /*----------------------------------------------------------------------*/ |
1073 | /* rxvt_Create_Windows () - Open and map the window */ |
1073 | /* rxvt_Create_Windows () - Open and map the window */ |
1074 | void |
1074 | void |
1075 | rxvt_term::create_windows (int argc, const char *const *argv) |
1075 | rxvt_term::create_windows (int argc, const char *const *argv) |
1076 | { |
1076 | { |
1077 | XClassHint classHint; |
1077 | XClassHint classHint; |
1078 | XWMHints wmHint; |
1078 | XWMHints wmHint; |
1079 | XGCValues gcvalue; |
1079 | XGCValues gcvalue; |
1080 | long vt_emask; |
1080 | long vt_emask; |
1081 | |
1081 | XSetWindowAttributes attributes; |
1082 | XWindowAttributes gattr; |
1082 | XWindowAttributes gattr; |
1083 | |
1083 | |
1084 | if (Options & Opt_transparent) |
1084 | if (Options & Opt_transparent) |
1085 | { |
1085 | { |
1086 | XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); |
1086 | XGetWindowAttributes (display->display, RootWindow (display->display, display->screen), &gattr); |
… | |
… | |
1099 | |
1099 | |
1100 | window_calc (0, 0); |
1100 | window_calc (0, 0); |
1101 | old_width = szHint.width; |
1101 | old_width = szHint.width; |
1102 | old_height = szHint.height; |
1102 | old_height = szHint.height; |
1103 | |
1103 | |
1104 | /* parent window - reverse video so we can see placement errors |
|
|
1105 | * sub-window placement & size in rxvt_resize_subwindows () |
1104 | /* sub-window placement & size in rxvt_resize_subwindows () */ |
1106 | */ |
|
|
1107 | |
1105 | |
1108 | #ifdef PREFER_24BIT |
1106 | #ifdef PREFER_24BIT |
1109 | XSetWindowAttributes attributes; |
|
|
1110 | |
|
|
1111 | attributes.background_pixel = PixColors[Color_fg]; |
1107 | attributes.background_pixel = PixColors[Color_bg]; |
1112 | attributes.border_pixel = PixColors[Color_border]; |
1108 | attributes.border_pixel = PixColors[Color_border]; |
1113 | attributes.colormap = display->cmap; |
1109 | attributes.colormap = display->cmap; |
1114 | TermWin.parent[0] = XCreateWindow (display->display, DefaultRootWindow (display->display), |
1110 | TermWin.parent[0] = XCreateWindow (display->display, DefaultRootWindow (display->display), |
1115 | szHint.x, szHint.y, |
1111 | szHint.x, szHint.y, |
1116 | szHint.width, szHint.height, |
1112 | szHint.width, szHint.height, |
1117 | TermWin.ext_bwidth, |
1113 | TermWin.ext_bwidth, |
1118 | display->depth, InputOutput, |
1114 | display->depth, InputOutput, |
1119 | display->visual, |
1115 | display->visual, |
1120 | CWBackPixel | CWBorderPixel | CWColormap, &attributes); |
1116 | CWColormap | CWBackPixel | CWBorderPixel, &attributes); |
1121 | #else |
1117 | #else |
1122 | TermWin.parent[0] = XCreateSimpleWindow (display->display, DefaultRootWindow (display->display), |
1118 | TermWin.parent[0] = XCreateSimpleWindow (display->display, DefaultRootWindow (display->display), |
1123 | szHint.x, szHint.y, |
1119 | szHint.x, szHint.y, |
1124 | szHint.width, |
1120 | szHint.width, szHint.height, |
1125 | szHint.height, |
|
|
1126 | TermWin.ext_bwidth, |
1121 | TermWin.ext_bwidth, |
1127 | PixColors[Color_border], |
1122 | PixColors[Color_border], |
1128 | PixColors[Color_fg]); |
1123 | PixColors[Color_bg]); |
1129 | #endif |
1124 | #endif |
1130 | |
1125 | |
1131 | process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1126 | process_xterm_seq (XTerm_title, rs[Rs_title], CHAR_ST); |
1132 | process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1127 | process_xterm_seq (XTerm_iconName, rs[Rs_iconName], CHAR_ST); |
1133 | |
1128 | |
1134 | classHint.res_name = (char *)rs[Rs_name]; |
1129 | classHint.res_name = (char *)rs[Rs_name]; |
1135 | classHint.res_class = (char *)RESCLASS; |
1130 | classHint.res_class = (char *)RESCLASS; |
1136 | |
1131 | |
1137 | wmHint.flags = (InputHint | StateHint | WindowGroupHint); |
1132 | wmHint.flags = InputHint | StateHint | WindowGroupHint; |
1138 | wmHint.input = True; |
1133 | wmHint.input = True; |
1139 | wmHint.initial_state = (Options & Opt_iconic ? IconicState |
1134 | wmHint.initial_state = Options & Opt_iconic ? IconicState : NormalState; |
1140 | : NormalState); |
|
|
1141 | wmHint.window_group = TermWin.parent[0]; |
1135 | wmHint.window_group = TermWin.parent[0]; |
1142 | |
1136 | |
1143 | XSetWMProperties (display->display, TermWin.parent[0], NULL, NULL, |
1137 | XSetWMProperties (display->display, TermWin.parent[0], NULL, NULL, |
1144 | (char **)argv, argc, &szHint, &wmHint, &classHint); |
1138 | (char **)argv, argc, &szHint, &wmHint, &classHint); |
1145 | |
1139 | |
… | |
… | |
1191 | |
1185 | |
1192 | #ifdef DEBUG_X |
1186 | #ifdef DEBUG_X |
1193 | XStoreName (display->display, TermWin.vt, "vt window"); |
1187 | XStoreName (display->display, TermWin.vt, "vt window"); |
1194 | #endif |
1188 | #endif |
1195 | |
1189 | |
|
|
1190 | attributes.bit_gravity = NorthWestGravity; |
|
|
1191 | XChangeWindowAttributes (display->display, TermWin.vt, CWBitGravity, &attributes); |
|
|
1192 | |
1196 | vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1193 | vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; |
1197 | | PropertyChangeMask); |
|
|
1198 | |
1194 | |
1199 | #ifdef POINTER_BLANK |
1195 | #ifdef POINTER_BLANK |
1200 | pointer_unblank (); |
1196 | pointer_unblank (); |
1201 | |
1197 | |
1202 | if ((Options & Opt_pointerBlank)) |
1198 | if (Options & Opt_pointerBlank) |
1203 | vt_emask |= PointerMotionMask; |
1199 | vt_emask |= PointerMotionMask; |
1204 | else |
1200 | else |
1205 | #endif |
1201 | #endif |
1206 | vt_emask |= (Button1MotionMask | Button3MotionMask); |
1202 | vt_emask |= Button1MotionMask | Button3MotionMask; |
1207 | |
1203 | |
1208 | XSelectInput (display->display, TermWin.vt, vt_emask); |
1204 | XSelectInput (display->display, TermWin.vt, vt_emask); |
1209 | vt_ev.start (display, TermWin.vt); |
1205 | vt_ev.start (display, TermWin.vt); |
1210 | |
1206 | |
1211 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |
1207 | #if defined(MENUBAR) && (MENUBAR_MAX > 1) |