aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
authorJason Rumney2009-04-19 15:09:25 +0000
committerJason Rumney2009-04-19 15:09:25 +0000
commit705af33f7ed44c4cc71165d45836f0b5a769f27d (patch)
tree4b115f73346b1ae99c2987225d655d5dfe495435 /src/w32term.c
parentdc2933ebde70fc2c236e352d6ae8d548568f1eb1 (diff)
downloademacs-705af33f7ed44c4cc71165d45836f0b5a769f27d.tar.gz
emacs-705af33f7ed44c4cc71165d45836f0b5a769f27d.zip
The following changes fix Bug#3005 for wide glyphs on each platform,
without reintroducing Bug#1258 for stretch glyphs. * xterm.c (x_draw_bar_cursor): Limit cursor width differently for BAR_CURSOR and HBAR_CURSOR. Calculate width of HBAR_CURSOR using get_phys_cursor_geometry. * w32term.c (x_draw_bar_cursor): Limit cursor width differently for BAR_CURSOR and HBAR_CURSOR. Calculate width of HBAR_CURSOR using get_phys_cursor_geometry. * nsterm.m (ns_draw_window_cursor): HBAR_CURSOR width already correctly calculated.
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/w32term.c b/src/w32term.c
index bc76ac58d1a..f38895b6312 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4970,8 +4970,6 @@ x_draw_bar_cursor (w, row, width, kind)
4970{ 4970{
4971 struct frame *f = XFRAME (w->frame); 4971 struct frame *f = XFRAME (w->frame);
4972 struct glyph *cursor_glyph; 4972 struct glyph *cursor_glyph;
4973 int x;
4974 HDC hdc;
4975 4973
4976 /* If cursor is out of bounds, don't draw garbage. This can happen 4974 /* If cursor is out of bounds, don't draw garbage. This can happen
4977 in mini-buffer windows when switching between echo area glyphs 4975 in mini-buffer windows when switching between echo area glyphs
@@ -4993,6 +4991,8 @@ x_draw_bar_cursor (w, row, width, kind)
4993 { 4991 {
4994 COLORREF cursor_color = f->output_data.w32->cursor_pixel; 4992 COLORREF cursor_color = f->output_data.w32->cursor_pixel;
4995 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id); 4993 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
4994 int x;
4995 HDC hdc;
4996 4996
4997 /* If the glyph's background equals the color we normally draw 4997 /* If the glyph's background equals the color we normally draw
4998 the bar cursor in, the bar cursor in its normal color is 4998 the bar cursor in, the bar cursor in its normal color is
@@ -5004,29 +5004,36 @@ x_draw_bar_cursor (w, row, width, kind)
5004 5004
5005 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 5005 x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
5006 5006
5007 if (width < 0)
5008 width = FRAME_CURSOR_WIDTH (f);
5009 width = min (cursor_glyph->pixel_width, width);
5010
5011 w->phys_cursor_width = width;
5012
5013
5014 hdc = get_frame_dc (f); 5007 hdc = get_frame_dc (f);
5015 w32_clip_to_row (w, row, TEXT_AREA, hdc); 5008 w32_clip_to_row (w, row, TEXT_AREA, hdc);
5016 5009
5017 if (kind == BAR_CURSOR) 5010 if (kind == BAR_CURSOR)
5018 { 5011 {
5012 if (width < 0)
5013 width = FRAME_CURSOR_WIDTH (f);
5014 width = min (cursor_glyph->pixel_width, width);
5015
5016 w->phys_cursor_width = width;
5017
5019 w32_fill_area (f, hdc, cursor_color, x, 5018 w32_fill_area (f, hdc, cursor_color, x,
5020 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y), 5019 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y),
5021 width, row->height); 5020 width, row->height);
5022 } 5021 }
5023 else 5022 else
5024 { 5023 {
5024 int dummy_x, dummy_y, dummy_h;
5025
5026 if (width < 0)
5027 width = row->height;
5028
5029 width = min (row->height, width);
5030
5031 get_phys_cursor_geometry (w, row, cursor_glyph, &dummy_x,
5032 &dummy_y, &dummy_h);
5025 w32_fill_area (f, hdc, cursor_color, x, 5033 w32_fill_area (f, hdc, cursor_color, x,
5026 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y + 5034 WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y +
5027 row->height - width), 5035 row->height - width),
5028 min (FRAME_COLUMN_WIDTH (f), cursor_glyph->pixel_width), 5036 w->phys_cursor_width, width);
5029 width);
5030 } 5037 }
5031 5038
5032 w32_set_clip_rectangle (hdc, NULL); 5039 w32_set_clip_rectangle (hdc, NULL);