1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: init.c |
2 | * File: init.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: init.C,v 1.5 2003/11/25 15:44:38 pcg Exp $ |
4 | * $Id: init.C,v 1.6 2003/11/25 17:11:33 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> |
… | |
… | |
1077 | XWindowAttributes gattr; |
1077 | XWindowAttributes gattr; |
1078 | |
1078 | |
1079 | XCMAP = DefaultColormap(R->Xdisplay, Xscreen); |
1079 | XCMAP = DefaultColormap(R->Xdisplay, Xscreen); |
1080 | XVISUAL = DefaultVisual(R->Xdisplay, Xscreen); |
1080 | XVISUAL = DefaultVisual(R->Xdisplay, Xscreen); |
1081 | |
1081 | |
1082 | #ifdef POINTER_BLANK |
|
|
1083 | static rxvt_color blackcolour; |
|
|
1084 | blackcolour.set (r, 0, 0, 0); |
|
|
1085 | #endif |
|
|
1086 | if (R->Options & Opt_transparent) { |
1082 | if (R->Options & Opt_transparent) { |
1087 | XGetWindowAttributes(R->Xdisplay, RootWindow(R->Xdisplay, Xscreen), |
1083 | XGetWindowAttributes(R->Xdisplay, RootWindow(R->Xdisplay, Xscreen), |
1088 | &gattr); |
1084 | &gattr); |
1089 | XDEPTH = gattr.depth; |
1085 | XDEPTH = gattr.depth; |
1090 | } else { |
1086 | } else { |
… | |
… | |
1164 | /* vt cursor: Black-on-White is standard, but this is more popular */ |
1160 | /* vt cursor: Black-on-White is standard, but this is more popular */ |
1165 | R->TermWin_cursor = XCreateFontCursor(R->Xdisplay, XC_xterm); |
1161 | R->TermWin_cursor = XCreateFontCursor(R->Xdisplay, XC_xterm); |
1166 | |
1162 | |
1167 | #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) |
1163 | #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) |
1168 | /* cursor (menuBar/scrollBar): Black-on-White */ |
1164 | /* cursor (menuBar/scrollBar): Black-on-White */ |
1169 | R->pointer_leftptr = XCreateFontCursor(R->Xdisplay, XC_left_ptr); |
1165 | R->leftptr_cursor = XCreateFontCursor(R->Xdisplay, XC_left_ptr); |
1170 | #endif |
1166 | #endif |
1171 | |
1167 | |
1172 | #ifdef POINTER_BLANK |
1168 | #ifdef POINTER_BLANK |
1173 | R->pointer_blank = XCreateGlyphCursor(R->Xdisplay, R->TermWin.font->fid, |
1169 | { |
1174 | R->TermWin.font->fid, ' ', ' ', |
1170 | XColor blackcolour; |
|
|
1171 | blackcolour.red = 0; |
|
|
1172 | blackcolour.green = 0; |
|
|
1173 | blackcolour.blue = 0; |
|
|
1174 | Font f = XLoadFont (R->Xdisplay, "fixed"); |
|
|
1175 | R->blank_cursor = XCreateGlyphCursor (R->Xdisplay, f, f, ' ', ' ', |
1175 | &blackcolour, &blackcolour); |
1176 | &blackcolour, &blackcolour); |
|
|
1177 | XUnloadFont (R->Xdisplay, f); |
|
|
1178 | } |
1176 | #endif |
1179 | #endif |
1177 | |
1180 | |
1178 | /* the vt window */ |
1181 | /* the vt window */ |
1179 | R->TermWin.vt = XCreateSimpleWindow(R->Xdisplay, R->TermWin.parent[0], |
1182 | R->TermWin.vt = XCreateSimpleWindow(R->Xdisplay, R->TermWin.parent[0], |
1180 | R->window_vt_x, R->window_vt_y, |
1183 | R->window_vt_x, R->window_vt_y, |
… | |
… | |
1184 | R->PixColors[Color_fg], |
1187 | R->PixColors[Color_fg], |
1185 | R->PixColors[Color_bg]); |
1188 | R->PixColors[Color_bg]); |
1186 | #ifdef DEBUG_X |
1189 | #ifdef DEBUG_X |
1187 | XStoreName(R->Xdisplay, R->TermWin.vt, "vt window"); |
1190 | XStoreName(R->Xdisplay, R->TermWin.vt, "vt window"); |
1188 | #endif |
1191 | #endif |
|
|
1192 | |
1189 | rxvt_pointer_unblank(aR); |
1193 | R->pointer_unblank (); |
|
|
1194 | |
1190 | vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1195 | vt_emask = (ExposureMask | ButtonPressMask | ButtonReleaseMask |
1191 | | PropertyChangeMask); |
1196 | | PropertyChangeMask); |
1192 | #ifdef POINTER_BLANK |
1197 | #ifdef POINTER_BLANK |
1193 | if ((R->Options & Opt_pointerBlank)) |
1198 | if ((R->Options & Opt_pointerBlank)) |
1194 | vt_emask |= PointerMotionMask; |
1199 | vt_emask |= PointerMotionMask; |