diff options
| author | Kim F. Storm | 2002-10-24 19:59:14 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-10-24 19:59:14 +0000 |
| commit | e9c990273f2a2728a7eab34db037fde06902bb60 (patch) | |
| tree | ba9105b9bd3677d087ecee6aa63aa112e240b5c7 /src | |
| parent | 1cdf2e12769c9461828ad720b9cff427e76addbb (diff) | |
| download | emacs-e9c990273f2a2728a7eab34db037fde06902bb60.tar.gz emacs-e9c990273f2a2728a7eab34db037fde06902bb60.zip | |
(get_window_cursor_type): New arg ACTIVE_CURSOR.
Callers changed (supply dummy arg).
Diffstat (limited to 'src')
| -rw-r--r-- | src/macterm.c | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 24 | ||||
| -rw-r--r-- | 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) | |||
| 9298 | struct frame *f = XFRAME (w->frame); | 9298 | struct frame *f = XFRAME (w->frame); |
| 9299 | int new_cursor_type; | 9299 | int new_cursor_type; |
| 9300 | int new_cursor_width; | 9300 | int new_cursor_width; |
| 9301 | int active_cursor; | ||
| 9301 | struct glyph_matrix *current_glyphs; | 9302 | struct glyph_matrix *current_glyphs; |
| 9302 | struct glyph_row *glyph_row; | 9303 | struct glyph_row *glyph_row; |
| 9303 | struct glyph *glyph; | 9304 | struct glyph *glyph; |
| @@ -9331,7 +9332,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 9331 | xassert (interrupt_input_blocked); | 9332 | xassert (interrupt_input_blocked); |
| 9332 | 9333 | ||
| 9333 | /* Set new_cursor_type to the cursor we want to be displayed. */ | 9334 | /* Set new_cursor_type to the cursor we want to be displayed. */ |
| 9334 | new_cursor_type = get_window_cursor_type (w, &new_cursor_width); | 9335 | new_cursor_type = get_window_cursor_type (w, &new_cursor_width, &active_cursor); |
| 9335 | 9336 | ||
| 9336 | 9337 | ||
| 9337 | /* If cursor is currently being shown and we don't want it to be or | 9338 | /* 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) | |||
| 15288 | } | 15288 | } |
| 15289 | 15289 | ||
| 15290 | 15290 | ||
| 15291 | /* Return the cursor we want to be displayed. In a mini-buffer | 15291 | /* Return the cursor we want to be displayed in window W. Return |
| 15292 | window, we want the cursor only to appear if we are reading input | 15292 | width of bar/hbar cursor through WIDTH arg. Return with |
| 15293 | from this window. For the selected window, we want the cursor type | 15293 | ACTIVE_CURSOR arg set to 1 if cursor in window W is `active' |
| 15294 | given by the frame parameter or buffer local setting of | 15294 | (i.e. if the `system caret' should track this cursor). |
| 15295 | cursor-type. If explicitly marked off, draw no cursor. In all | 15295 | |
| 15296 | other cases, we want a hollow box cursor. */ | 15296 | In a mini-buffer window, we want the cursor only to appear if we |
| 15297 | are reading input from this window. For the selected window, we | ||
| 15298 | want the cursor type given by the frame parameter or buffer local | ||
| 15299 | setting of cursor-type. If explicitly marked off, draw no cursor. | ||
| 15300 | In all other cases, we want a hollow box cursor. */ | ||
| 15297 | 15301 | ||
| 15298 | enum text_cursor_kinds | 15302 | enum text_cursor_kinds |
| 15299 | get_window_cursor_type (w, width) | 15303 | get_window_cursor_type (w, width, active_cursor) |
| 15300 | struct window *w; | 15304 | struct window *w; |
| 15301 | int *width; | 15305 | int *width; |
| 15306 | int *active_cursor; | ||
| 15302 | { | 15307 | { |
| 15303 | struct frame *f = XFRAME (w->frame); | 15308 | struct frame *f = XFRAME (w->frame); |
| 15304 | struct buffer *b = XBUFFER (w->buffer); | 15309 | struct buffer *b = XBUFFER (w->buffer); |
| @@ -15306,6 +15311,8 @@ get_window_cursor_type (w, width) | |||
| 15306 | Lisp_Object alt_cursor; | 15311 | Lisp_Object alt_cursor; |
| 15307 | int non_selected = 0; | 15312 | int non_selected = 0; |
| 15308 | 15313 | ||
| 15314 | *active_cursor = 1; | ||
| 15315 | |||
| 15309 | /* Echo area */ | 15316 | /* Echo area */ |
| 15310 | if (cursor_in_echo_area | 15317 | if (cursor_in_echo_area |
| 15311 | && FRAME_HAS_MINIBUF_P (f) | 15318 | && FRAME_HAS_MINIBUF_P (f) |
| @@ -15317,6 +15324,7 @@ get_window_cursor_type (w, width) | |||
| 15317 | return FRAME_DESIRED_CURSOR (f); | 15324 | return FRAME_DESIRED_CURSOR (f); |
| 15318 | } | 15325 | } |
| 15319 | 15326 | ||
| 15327 | *active_cursor = 0; | ||
| 15320 | non_selected = 1; | 15328 | non_selected = 1; |
| 15321 | } | 15329 | } |
| 15322 | 15330 | ||
| @@ -15327,6 +15335,8 @@ get_window_cursor_type (w, width) | |||
| 15327 | #endif | 15335 | #endif |
| 15328 | ) | 15336 | ) |
| 15329 | { | 15337 | { |
| 15338 | *active_cursor = 0; | ||
| 15339 | |||
| 15330 | if (MINI_WINDOW_P (w) && minibuf_level == 0) | 15340 | if (MINI_WINDOW_P (w) && minibuf_level == 0) |
| 15331 | return NO_CURSOR; | 15341 | return NO_CURSOR; |
| 15332 | 15342 | ||
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) | |||
| 11802 | struct frame *f = XFRAME (w->frame); | 11802 | struct frame *f = XFRAME (w->frame); |
| 11803 | int new_cursor_type; | 11803 | int new_cursor_type; |
| 11804 | int new_cursor_width; | 11804 | int new_cursor_width; |
| 11805 | int active_cursor; | ||
| 11805 | struct glyph_matrix *current_glyphs; | 11806 | struct glyph_matrix *current_glyphs; |
| 11806 | struct glyph_row *glyph_row; | 11807 | struct glyph_row *glyph_row; |
| 11807 | struct glyph *glyph; | 11808 | struct glyph *glyph; |
| @@ -11835,7 +11836,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11835 | xassert (interrupt_input_blocked); | 11836 | xassert (interrupt_input_blocked); |
| 11836 | 11837 | ||
| 11837 | /* Set new_cursor_type to the cursor we want to be displayed. */ | 11838 | /* Set new_cursor_type to the cursor we want to be displayed. */ |
| 11838 | new_cursor_type = get_window_cursor_type (w, &new_cursor_width); | 11839 | new_cursor_type = get_window_cursor_type (w, &new_cursor_width, &active_cursor); |
| 11839 | 11840 | ||
| 11840 | /* If cursor is currently being shown and we don't want it to be or | 11841 | /* If cursor is currently being shown and we don't want it to be or |
| 11841 | it is in the wrong place, or the cursor type is not what we want, | 11842 | it is in the wrong place, or the cursor type is not what we want, |