diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-07-14 04:24:24 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-07-14 04:24:24 +0000 |
commit | 42d03f4655d1f39127b15a4840f48234006c5451 (patch) | |
tree | 1747e0689a823af0a646bf6e8aa0aee34888564d /src/xterm.c | |
parent | 5d476e3d4d2f782eed0ae46421bdd8ece29356cf (diff) | |
download | emacs-42d03f4655d1f39127b15a4840f48234006c5451.tar.gz |
(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.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c index 005c3d33fbf..b8c88bcaf65 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); } |