diff options
| author | YAMAMOTO Mitsuharu | 2014-10-22 10:39:48 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2014-10-22 10:39:48 +0900 |
| commit | 1a7aa3ce7fe32955f45ba8cfee2ccaf4a0770395 (patch) | |
| tree | c990ecee5022be8403ffd128adc4d40db07db0e7 | |
| parent | 249836259909ce1533ced5dee96049b3b919e93d (diff) | |
| download | emacs-1a7aa3ce7fe32955f45ba8cfee2ccaf4a0770395.tar.gz emacs-1a7aa3ce7fe32955f45ba8cfee2ccaf4a0770395.zip | |
* xdisp.c (erase_phys_cursor): Fix confusion between window-relative and text area-relative x-coordinates. [Backport]
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b9451fb9006..28af5026928 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * xdisp.c (draw_glyphs): Set clipping to highlight boundaries. | 3 | * xdisp.c (draw_glyphs): Set clipping to highlight boundaries. |
| 4 | [Backport] | 4 | [Backport] |
| 5 | (erase_phys_cursor): Fix confusion between window-relative and | ||
| 6 | text area-relative x-coordinates. [Backport] | ||
| 5 | 7 | ||
| 6 | 2014-10-20 Glenn Morris <rgm@gnu.org> | 8 | 2014-10-20 Glenn Morris <rgm@gnu.org> |
| 7 | 9 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index da56885d2eb..f0726ecce70 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -27467,7 +27467,7 @@ erase_phys_cursor (struct window *w) | |||
| 27467 | /* Maybe clear the display under the cursor. */ | 27467 | /* Maybe clear the display under the cursor. */ |
| 27468 | if (w->phys_cursor_type == HOLLOW_BOX_CURSOR) | 27468 | if (w->phys_cursor_type == HOLLOW_BOX_CURSOR) |
| 27469 | { | 27469 | { |
| 27470 | int x, y, left_x; | 27470 | int x, y; |
| 27471 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); | 27471 | int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); |
| 27472 | int width; | 27472 | int width; |
| 27473 | 27473 | ||
| @@ -27476,13 +27476,15 @@ erase_phys_cursor (struct window *w) | |||
| 27476 | goto mark_cursor_off; | 27476 | goto mark_cursor_off; |
| 27477 | 27477 | ||
| 27478 | width = cursor_glyph->pixel_width; | 27478 | width = cursor_glyph->pixel_width; |
| 27479 | left_x = window_box_left_offset (w, TEXT_AREA); | ||
| 27480 | x = w->phys_cursor.x; | 27479 | x = w->phys_cursor.x; |
| 27481 | if (x < left_x) | 27480 | if (x < 0) |
| 27482 | width -= left_x - x; | 27481 | { |
| 27482 | width += x; | ||
| 27483 | x = 0; | ||
| 27484 | } | ||
| 27483 | width = min (width, window_box_width (w, TEXT_AREA) - x); | 27485 | width = min (width, window_box_width (w, TEXT_AREA) - x); |
| 27484 | y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y)); | 27486 | y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y)); |
| 27485 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x)); | 27487 | x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, x); |
| 27486 | 27488 | ||
| 27487 | if (width > 0) | 27489 | if (width > 0) |
| 27488 | FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height); | 27490 | FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height); |