aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1997-07-14 04:24:24 +0000
committerRichard M. Stallman <[email protected]>1997-07-14 04:24:24 +0000
commit5c1aae96f952b34e78042c330845ac57be996a3c (patch)
treeb3e24743cb4596c552b3dc40aa658cdf4e43bf57 /src/xterm.c
parent9e4555e816f1c18d8751d43fa1aad44c1ac74059 (diff)
(x_draw_box): Use scratch_cursor_gc to draw the cursor
box using the color specified by cursor_pixel.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 005c3d33fb..b8c88bcaf6 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4593,12 +4593,27 @@ x_draw_box (f, x, y)
int c = FAST_GLYPH_CHAR (f->phys_cursor_glyph);
int charset = CHAR_CHARSET (c);
+ XGCValues xgcv;
+ unsigned long mask = GCForeground;
+
+ xgcv.foreground = f->output_data.x->cursor_pixel;
+
+ /* cursor_gc's foreground color is typically the same as the normal
+ background color, which can cause the cursor box to be invisible. */
+ if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc)
+ XChangeGC (FRAME_X_DISPLAY (f),
+ FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,
+ mask, &xgcv);
+ else
+ FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc
+ = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), mask, &xgcv);
+
/* If cursor is on a multi-column character, multiply WIDTH by columns. */
width *= (charset == CHARSET_COMPOSITION
? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width
: CHARSET_WIDTH (charset));
XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- f->output_data.x->cursor_gc,
+ FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,
left, top, width - 1, height - 1);
}