# HG changeset patch # User Richard M. Stallman # Date 868854264 0 # Node ID fcfa336f737e789e9734a82d717b0e618203e48b # Parent 95b4ac950a5d091ced8535bd57fd5fdc7d5fd6ab (x_draw_box): Use scratch_cursor_gc to draw the cursor box using the color specified by cursor_pixel. diff -r 95b4ac950a5d -r fcfa336f737e src/xterm.c --- a/src/xterm.c Sun Jul 13 23:20:41 1997 +0000 +++ b/src/xterm.c Mon Jul 14 04:24:24 1997 +0000 @@ -4593,12 +4593,27 @@ 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); }