From e9c990273f2a2728a7eab34db037fde06902bb60 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 24 Oct 2002 19:59:14 +0000 Subject: [PATCH] (get_window_cursor_type): New arg ACTIVE_CURSOR. Callers changed (supply dummy arg). --- src/macterm.c | 3 ++- src/xdisp.c | 24 +++++++++++++++++------- src/xterm.c | 3 ++- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/macterm.c b/src/macterm.c index 59b41a19e75..5da54e2c73f 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -9298,6 +9298,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) 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 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) 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 --git a/src/xdisp.c b/src/xdisp.c index e3f2ecc134b..f80c3447624 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15288,17 +15288,22 @@ set_frame_cursor_types (f, arg) } -/* 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 @@ get_window_cursor_type (w, width) 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 @@ get_window_cursor_type (w, width) return FRAME_DESIRED_CURSOR (f); } + *active_cursor = 0; non_selected = 1; } @@ -15327,6 +15335,8 @@ get_window_cursor_type (w, width) #endif ) { + *active_cursor = 0; + if (MINI_WINDOW_P (w) && minibuf_level == 0) return NO_CURSOR; diff --git a/src/xterm.c b/src/xterm.c index 36325e3973d..7d0b6728f06 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11802,6 +11802,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) 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 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) 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, -- 2.39.2