aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorKim F. Storm2002-08-30 12:05:04 +0000
committerKim F. Storm2002-08-30 12:05:04 +0000
commitfdbe859cfbccfa746642d524c582bd86bc86c383 (patch)
tree6ae63efde1b7d40e64e796cdd9496937db755c87 /src/w32term.c
parent33b2311e862c021a5dc956e2bc1335735bf8b8aa (diff)
downloademacs-fdbe859cfbccfa746642d524c582bd86bc86c383.tar.gz
emacs-fdbe859cfbccfa746642d524c582bd86bc86c383.zip
(x_specified_cursor_type): Remove prototype.
(x_draw_bar_cursor): Use FRAME_CURSOR_WIDTH. (x_display_and_set_cursor): Use get_window_cursor_type. Remove unused local variables cursor_off_state. Redraw cursor if hbar cursor width changes.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c76
1 files changed, 4 insertions, 72 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 87a4b2156b0..64643dadc77 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -9537,7 +9537,7 @@ x_draw_bar_cursor (w, row, width, kind)
9537 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id); 9537 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
9538 9538
9539 if (width < 0) 9539 if (width < 0)
9540 width = f->output_data.w32->cursor_width; 9540 width = FRAME_CURSOR_WIDTH (f);
9541 width = min (cursor_glyph->pixel_width, width); 9541 width = min (cursor_glyph->pixel_width, width);
9542 9542
9543 /* If the glyph's background equals the color we normally draw 9543 /* If the glyph's background equals the color we normally draw
@@ -9759,7 +9759,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9759 struct frame *f = XFRAME (w->frame); 9759 struct frame *f = XFRAME (w->frame);
9760 int new_cursor_type; 9760 int new_cursor_type;
9761 int new_cursor_width; 9761 int new_cursor_width;
9762 int cursor_off_state = 0;
9763 struct glyph_matrix *current_glyphs; 9762 struct glyph_matrix *current_glyphs;
9764 struct glyph_row *glyph_row; 9763 struct glyph_row *glyph_row;
9765 struct glyph *glyph; 9764 struct glyph *glyph;
@@ -9794,75 +9793,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9794 9793
9795 xassert (interrupt_input_blocked); 9794 xassert (interrupt_input_blocked);
9796 9795
9797 /* Set new_cursor_type to the cursor we want to be displayed. In a 9796 /* Set new_cursor_type to the cursor we want to be displayed. */
9798 mini-buffer window, we want the cursor only to appear if we are 9797 new_cursor_type = get_window_cursor_type (w, &new_cursor_width);
9799 reading input from this window. For the selected window, we want
9800 the cursor type given by the frame parameter. If explicitly
9801 marked off, draw no cursor. In all other cases, we want a hollow
9802 box cursor. */
9803 new_cursor_width = -1;
9804 new_cursor_type = -2;
9805
9806 /* Echo area */
9807 if (cursor_in_echo_area
9808 && FRAME_HAS_MINIBUF_P (f)
9809 && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window))
9810 {
9811 if (w == XWINDOW (echo_area_window))
9812 new_cursor_type = FRAME_DESIRED_CURSOR (f);
9813 else if (NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,
9814 w->buffer)))
9815 new_cursor_type = NO_CURSOR;
9816 else
9817 cursor_off_state = 1;
9818 }
9819
9820 /* Nonselected window or nonselected frame. */
9821 else if (f != FRAME_X_DISPLAY_INFO (f)->w32_highlight_frame
9822 || w != XWINDOW (f->selected_window))
9823 {
9824 if ((MINI_WINDOW_P (w) && minibuf_level == 0)
9825 || NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows,
9826 w->buffer))
9827 || NILP (XBUFFER (w->buffer)->cursor_type))
9828 new_cursor_type = NO_CURSOR;
9829 else
9830 cursor_off_state = 1;
9831 }
9832
9833 /* If new_cursor_type isn't decided yet, decide it now. */
9834 if (new_cursor_type == -2)
9835 {
9836 struct buffer *b = XBUFFER (w->buffer);
9837
9838 if (EQ (b->cursor_type, Qt))
9839 {
9840 new_cursor_type = FRAME_DESIRED_CURSOR (f);
9841 new_cursor_width = FRAME_CURSOR_WIDTH (f);
9842 }
9843 else
9844 new_cursor_type = x_specified_cursor_type (b->cursor_type,
9845 &new_cursor_width);
9846 }
9847
9848 /* If cursor has blinked off, use the other specified state. */
9849 if (w->cursor_off_p)
9850 {
9851 new_cursor_type = FRAME_BLINK_OFF_CURSOR (f);
9852 new_cursor_width = FRAME_BLINK_OFF_CURSOR_WIDTH (f);
9853 }
9854 /* Dim out or hollow out the cursor for nonselected windows. */
9855 if (cursor_off_state)
9856 {
9857 if (new_cursor_type == FILLED_BOX_CURSOR)
9858 new_cursor_type = HOLLOW_BOX_CURSOR;
9859 else if (new_cursor_type == BAR_CURSOR && new_cursor_width > 1)
9860 new_cursor_width = 1;
9861 else
9862 new_cursor_type = NO_CURSOR;
9863 }
9864
9865 /* Now new_cursor_type is correct. */
9866 9798
9867 /* If cursor is currently being shown and we don't want it to be or 9799 /* If cursor is currently being shown and we don't want it to be or
9868 it is in the wrong place, or the cursor type is not what we want, 9800 it is in the wrong place, or the cursor type is not what we want,
@@ -9872,7 +9804,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y)
9872 || w->phys_cursor.x != x 9804 || w->phys_cursor.x != x
9873 || w->phys_cursor.y != y 9805 || w->phys_cursor.y != y
9874 || new_cursor_type != w->phys_cursor_type 9806 || new_cursor_type != w->phys_cursor_type
9875 || (new_cursor_type == BAR_CURSOR 9807 || ((new_cursor_type == BAR_CURSOR || new_cursor_type == HBAR_CURSOR)
9876 && new_cursor_width != w->phys_cursor_width))) 9808 && new_cursor_width != w->phys_cursor_width)))
9877 x_erase_phys_cursor (w); 9809 x_erase_phys_cursor (w);
9878 9810