# HG changeset patch # User Kim F. Storm # Date 1035489554 0 # Node ID 5dcac67745dc22ddff7b25b4cbf0d3016d5ac483 # Parent 3762c03998174718db94e53b4d3db4eb6e62e597 (get_window_cursor_type): New arg ACTIVE_CURSOR. Callers changed (supply dummy arg). diff -r 3762c0399817 -r 5dcac67745dc src/macterm.c --- a/src/macterm.c Thu Oct 24 19:58:23 2002 +0000 +++ b/src/macterm.c Thu Oct 24 19:59:14 2002 +0000 @@ -9298,6 +9298,7 @@ struct frame *f = XFRAME (w->frame); int new_cursor_type; int new_cursor_width; + int active_cursor; struct glyph_matrix *current_glyphs; struct glyph_row *glyph_row; struct glyph *glyph; @@ -9331,7 +9332,7 @@ xassert (interrupt_input_blocked); /* Set new_cursor_type to the cursor we want to be displayed. */ - new_cursor_type = get_window_cursor_type (w, &new_cursor_width); + new_cursor_type = get_window_cursor_type (w, &new_cursor_width, &active_cursor); /* If cursor is currently being shown and we don't want it to be or diff -r 3762c0399817 -r 5dcac67745dc src/xdisp.c --- a/src/xdisp.c Thu Oct 24 19:58:23 2002 +0000 +++ b/src/xdisp.c Thu Oct 24 19:59:14 2002 +0000 @@ -15288,17 +15288,22 @@ } -/* Return the cursor we want to be displayed. In a mini-buffer - window, we want the cursor only to appear if we are reading input - from this window. For the selected window, we want the cursor type - given by the frame parameter or buffer local setting of - cursor-type. If explicitly marked off, draw no cursor. In all - other cases, we want a hollow box cursor. */ +/* Return the cursor we want to be displayed in window W. Return + width of bar/hbar cursor through WIDTH arg. Return with + ACTIVE_CURSOR arg set to 1 if cursor in window W is `active' + (i.e. if the `system caret' should track this cursor). + + In a mini-buffer window, we want the cursor only to appear if we + are reading input from this window. For the selected window, we + want the cursor type given by the frame parameter or buffer local + setting of cursor-type. If explicitly marked off, draw no cursor. + In all other cases, we want a hollow box cursor. */ enum text_cursor_kinds -get_window_cursor_type (w, width) +get_window_cursor_type (w, width, active_cursor) struct window *w; int *width; + int *active_cursor; { struct frame *f = XFRAME (w->frame); struct buffer *b = XBUFFER (w->buffer); @@ -15306,6 +15311,8 @@ Lisp_Object alt_cursor; int non_selected = 0; + *active_cursor = 1; + /* Echo area */ if (cursor_in_echo_area && FRAME_HAS_MINIBUF_P (f) @@ -15317,6 +15324,7 @@ return FRAME_DESIRED_CURSOR (f); } + *active_cursor = 0; non_selected = 1; } @@ -15327,6 +15335,8 @@ #endif ) { + *active_cursor = 0; + if (MINI_WINDOW_P (w) && minibuf_level == 0) return NO_CURSOR; diff -r 3762c0399817 -r 5dcac67745dc src/xterm.c --- a/src/xterm.c Thu Oct 24 19:58:23 2002 +0000 +++ b/src/xterm.c Thu Oct 24 19:59:14 2002 +0000 @@ -11802,6 +11802,7 @@ struct frame *f = XFRAME (w->frame); int new_cursor_type; int new_cursor_width; + int active_cursor; struct glyph_matrix *current_glyphs; struct glyph_row *glyph_row; struct glyph *glyph; @@ -11835,7 +11836,7 @@ xassert (interrupt_input_blocked); /* Set new_cursor_type to the cursor we want to be displayed. */ - new_cursor_type = get_window_cursor_type (w, &new_cursor_width); + new_cursor_type = get_window_cursor_type (w, &new_cursor_width, &active_cursor); /* If cursor is currently being shown and we don't want it to be or it is in the wrong place, or the cursor type is not what we want,