aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-07-14 04:24:24 +0000
committerRichard M. Stallman1997-07-14 04:24:24 +0000
commit5c1aae96f952b34e78042c330845ac57be996a3c (patch)
treeb3e24743cb4596c552b3dc40aa658cdf4e43bf57 /src
parent9e4555e816f1c18d8751d43fa1aad44c1ac74059 (diff)
downloademacs-5c1aae96f952b34e78042c330845ac57be996a3c.tar.gz
emacs-5c1aae96f952b34e78042c330845ac57be996a3c.zip
(x_draw_box): Use scratch_cursor_gc to draw the cursor
box using the color specified by cursor_pixel.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c17
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)
4593 int c = FAST_GLYPH_CHAR (f->phys_cursor_glyph); 4593 int c = FAST_GLYPH_CHAR (f->phys_cursor_glyph);
4594 int charset = CHAR_CHARSET (c); 4594 int charset = CHAR_CHARSET (c);
4595 4595
4596 XGCValues xgcv;
4597 unsigned long mask = GCForeground;
4598
4599 xgcv.foreground = f->output_data.x->cursor_pixel;
4600
4601 /* cursor_gc's foreground color is typically the same as the normal
4602 background color, which can cause the cursor box to be invisible. */
4603 if (FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc)
4604 XChangeGC (FRAME_X_DISPLAY (f),
4605 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,
4606 mask, &xgcv);
4607 else
4608 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc
4609 = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), mask, &xgcv);
4610
4596 /* If cursor is on a multi-column character, multiply WIDTH by columns. */ 4611 /* If cursor is on a multi-column character, multiply WIDTH by columns. */
4597 width *= (charset == CHARSET_COMPOSITION 4612 width *= (charset == CHARSET_COMPOSITION
4598 ? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width 4613 ? cmpchar_table[COMPOSITE_CHAR_ID (c)]->width
4599 : CHARSET_WIDTH (charset)); 4614 : CHARSET_WIDTH (charset));
4600 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 4615 XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
4601 f->output_data.x->cursor_gc, 4616 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc,
4602 left, top, width - 1, height - 1); 4617 left, top, width - 1, height - 1);
4603} 4618}
4604 4619