comparison src/w32term.c @ 71021:a86a3503e350

(x_draw_stretch_glyph_string): Fix problems with invisible cursor and erasing cursor on partially visible stretch glyph on left. (x_draw_hollow_cursor): Compute x via get_phys_cursor_geometry.
author Kim F. Storm <storm@cua.dk>
date Sat, 27 May 2006 22:37:39 +0000
parents 4282b2a1849b
children 3aec67200140
comparison
equal deleted inserted replaced
71020:3cc856b86408 71021:a86a3503e350
2387 if (s->hl == DRAW_CURSOR 2387 if (s->hl == DRAW_CURSOR
2388 && !x_stretch_cursor_p) 2388 && !x_stretch_cursor_p)
2389 { 2389 {
2390 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor 2390 /* If `x-stretch-block-cursor' is nil, don't draw a block cursor
2391 as wide as the stretch glyph. */ 2391 as wide as the stretch glyph. */
2392 int width = min (FRAME_COLUMN_WIDTH (s->f), s->background_width); 2392 int width, background_width = s->background_width;
2393 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
2394
2395 if (x < left_x)
2396 {
2397 background_width -= left_x - x;
2398 x = left_x;
2399 }
2400 width = min (FRAME_COLUMN_WIDTH (s->f), background_width);
2393 2401
2394 /* Draw cursor. */ 2402 /* Draw cursor. */
2395 x_draw_glyph_string_bg_rect (s, s->x, s->y, width, s->height); 2403 x_draw_glyph_string_bg_rect (s, x, s->y, width, s->height);
2396 2404
2397 /* Clear rest using the GC of the original non-cursor face. */ 2405 /* Clear rest using the GC of the original non-cursor face. */
2398 if (width < s->background_width) 2406 if (width < background_width)
2399 { 2407 {
2400 XGCValues *gc = s->face->gc; 2408 XGCValues *gc = s->face->gc;
2401 int x = s->x + width, y = s->y; 2409 int y = s->y;
2402 int w = s->background_width - width, h = s->height; 2410 int w = background_width - width, h = s->height;
2403 RECT r; 2411 RECT r;
2404 HDC hdc = s->hdc; 2412 HDC hdc = s->hdc;
2405 2413
2414 x += width;
2406 if (s->row->mouse_face_p 2415 if (s->row->mouse_face_p
2407 && cursor_in_mouse_face_p (s->w)) 2416 && cursor_in_mouse_face_p (s->w))
2408 { 2417 {
2409 x_set_mouse_face_gc (s); 2418 x_set_mouse_face_gc (s);
2410 gc = s->gc; 2419 gc = s->gc;
2429 w32_fill_area (s->f, s->hdc, gc->background, x, y, w, h); 2438 w32_fill_area (s->f, s->hdc, gc->background, x, y, w, h);
2430 } 2439 }
2431 } 2440 }
2432 } 2441 }
2433 else if (!s->background_filled_p) 2442 else if (!s->background_filled_p)
2434 x_draw_glyph_string_bg_rect (s, s->x, s->y, s->background_width, 2443 {
2435 s->height); 2444 int background_width = s->background_width;
2445 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
2446
2447 if (x < left_x)
2448 {
2449 background_width -= left_x - x;
2450 x = left_x;
2451 }
2452 if (background_width > 0)
2453 x_draw_glyph_string_bg_rect (s, x, s->y, background_width, s->height);
2436 2454
2437 s->background_filled_p = 1; 2455 s->background_filled_p = 1;
2438 } 2456 }
2439 2457
2440 2458
4940 cursor_glyph = get_phys_cursor_glyph (w); 4958 cursor_glyph = get_phys_cursor_glyph (w);
4941 if (cursor_glyph == NULL) 4959 if (cursor_glyph == NULL)
4942 return; 4960 return;
4943 4961
4944 /* Compute frame-relative coordinates for phys cursor. */ 4962 /* Compute frame-relative coordinates for phys cursor. */
4945 rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); 4963 get_phys_cursor_geometry (w, row, cursor_glyph, &rect.left, &rect.top, &h);
4946 rect.top = get_phys_cursor_geometry (w, row, cursor_glyph, &h);
4947 rect.bottom = rect.top + h; 4964 rect.bottom = rect.top + h;
4948 rect.right = rect.left + w->phys_cursor_width; 4965 rect.right = rect.left + w->phys_cursor_width;
4949 4966
4950 hdc = get_frame_dc (f); 4967 hdc = get_frame_dc (f);
4951 /* Set clipping, draw the rectangle, and reset clipping again. */ 4968 /* Set clipping, draw the rectangle, and reset clipping again. */