aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2004-05-01 10:10:36 +0000
committerJason Rumney2004-05-01 10:10:36 +0000
commit07c07cfe9aabcd7b421d3cf28be9348c1918a639 (patch)
tree6d0a10432fa2fb3950ae0c151da4b78b562165bf
parent4ae73f87a0f3ab6f9b7cdca19a3df40d945fc7a9 (diff)
downloademacs-07c07cfe9aabcd7b421d3cf28be9348c1918a639.tar.gz
emacs-07c07cfe9aabcd7b421d3cf28be9348c1918a639.zip
(x_draw_hollow_cursor): Sync with xterm.c
-rw-r--r--src/ChangeLog4
-rw-r--r--src/w32term.c29
2 files changed, 23 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f8a9e5fb767..46dbdcb2fc0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12004-05-01 Jason Rumney <jasonr@gnu.org>
2
3 * w32term.c (x_draw_hollow_cursor): Sync with xterm.c
4
12004-04-30 Kim F. Storm <storm@cua.dk> 52004-04-30 Kim F. Storm <storm@cua.dk>
2 6
3 * buffer.c (syms_of_buffer) <line-spacing>: Allow float value. 7 * buffer.c (syms_of_buffer) <line-spacing>: Allow float value.
diff --git a/src/w32term.c b/src/w32term.c
index 6654b1a4087..93a3d7d61c9 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4177,8 +4177,7 @@ w32_read_socket (sd, expected, hold_quit)
4177 /* So people can tell when we have read the available input. */ 4177 /* So people can tell when we have read the available input. */
4178 input_signal_count++; 4178 input_signal_count++;
4179 4179
4180 /* TODO: tool-bars, ghostscript integration, mouse 4180 /* TODO: ghostscript integration. */
4181 cursors. */
4182 while (get_next_msg (&msg, FALSE)) 4181 while (get_next_msg (&msg, FALSE))
4183 { 4182 {
4184 struct input_event inev; 4183 struct input_event inev;
@@ -4934,28 +4933,38 @@ x_draw_hollow_cursor (w, row)
4934 struct frame *f = XFRAME (WINDOW_FRAME (w)); 4933 struct frame *f = XFRAME (WINDOW_FRAME (w));
4935 HDC hdc; 4934 HDC hdc;
4936 RECT rect; 4935 RECT rect;
4937 int wd; 4936 int wd, h;
4938 struct glyph *cursor_glyph; 4937 struct glyph *cursor_glyph;
4939 HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); 4938 HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel);
4940 4939
4940 /* Get the glyph the cursor is on. If we can't tell because
4941 the current matrix is invalid or such, give up. */
4942 cursor_glyph = get_phys_cursor_glyph (w);
4943 if (cursor_glyph == NULL)
4944 return;
4945
4941 /* Compute frame-relative coordinates from window-relative 4946 /* Compute frame-relative coordinates from window-relative
4942 coordinates. */ 4947 coordinates. */
4943 rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 4948 rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x);
4944 rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) 4949 rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y)
4945 + row->ascent - w->phys_cursor_ascent); 4950 + row->ascent - w->phys_cursor_ascent);
4946 rect.bottom = rect.top + row->height;
4947 4951
4948 /* Get the glyph the cursor is on. If we can't tell because 4952 /* Compute the proper height and ascent of the rectangle, based
4949 the current matrix is invalid or such, give up. */ 4953 on the actual glyph. Using the full height of the row looks
4950 cursor_glyph = get_phys_cursor_glyph (w); 4954 bad when there are tall images on that row. */
4951 if (cursor_glyph == NULL) 4955 h = max (min (FRAME_LINE_HEIGHT (f), row->height),
4952 return; 4956 cursor_glyph->ascent + cursor_glyph->descent);
4957 if (h < row->height)
4958 rect.top += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h;
4959 h--;
4960
4961 rect.bottom = rect.top + h;
4953 4962
4954 /* Compute the width of the rectangle to draw. If on a stretch 4963 /* Compute the width of the rectangle to draw. If on a stretch
4955 glyph, and `x-stretch-block-cursor' is nil, don't draw a 4964 glyph, and `x-stretch-block-cursor' is nil, don't draw a
4956 rectangle as wide as the glyph, but use a canonical character 4965 rectangle as wide as the glyph, but use a canonical character
4957 width instead. */ 4966 width instead. */
4958 wd = cursor_glyph->pixel_width; 4967 wd = cursor_glyph->pixel_width; /* TODO: Why off by one compared with X? */
4959 if (cursor_glyph->type == STRETCH_GLYPH 4968 if (cursor_glyph->type == STRETCH_GLYPH
4960 && !x_stretch_cursor_p) 4969 && !x_stretch_cursor_p)
4961 wd = min (FRAME_COLUMN_WIDTH (f), wd); 4970 wd = min (FRAME_COLUMN_WIDTH (f), wd);