diff options
| author | Gerd Moellmann | 2002-04-23 10:34:23 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2002-04-23 10:34:23 +0000 |
| commit | b3738089df517937f7ddc13a8f00a7a59280729a (patch) | |
| tree | 9faed92b67f92cce1384a87cb3c2d7a2d3548598 | |
| parent | 8fba10fcc33b8809059ae3ee669eaf78a78345d4 (diff) | |
| download | emacs-b3738089df517937f7ddc13a8f00a7a59280729a.tar.gz emacs-b3738089df517937f7ddc13a8f00a7a59280729a.zip | |
(x_draw_hollow_cursor, x_draw_bar_cursor)
(x_draw_phys_cursor_glyph): Set phys_cursor_width here.
(x_display_and_set_cursor): Don't set phys_cursor_width here for
bar cursors only, to make phys_cursor_width contain what its name
suggests.
(notice_overwritten_cursor): Consider the cursor image erased if
the output area intersects the cursor image in y-direction.
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/xterm.c | 45 |
2 files changed, 45 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index df458e29f54..54ee39a2314 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2002-04-23 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_hollow_cursor, x_draw_bar_cursor) | ||
| 4 | (x_draw_phys_cursor_glyph): Set phys_cursor_width here. | ||
| 5 | (x_display_and_set_cursor): Don't set phys_cursor_width here, for | ||
| 6 | bar cursors only, to make phys_cursor_width contain what its name | ||
| 7 | suggests. | ||
| 8 | (notice_overwritten_cursor): Consider the cursor image erased if | ||
| 9 | the output area intersects the cursor image in y-direction. | ||
| 10 | |||
| 1 | 2002-04-23 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 11 | 2002-04-23 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 12 | ||
| 3 | * xdisp.c: Remove unused global variable | 13 | * xdisp.c: Remove unused global variable |
diff --git a/src/xterm.c b/src/xterm.c index defb764b7ea..9088d7a0e80 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11226,13 +11226,29 @@ notice_overwritten_cursor (w, area, x0, x1, y0, y1) | |||
| 11226 | enum glyph_row_area area; | 11226 | enum glyph_row_area area; |
| 11227 | int x0, y0, x1, y1; | 11227 | int x0, y0, x1, y1; |
| 11228 | { | 11228 | { |
| 11229 | if (area == TEXT_AREA | 11229 | if (area == TEXT_AREA && w->phys_cursor_on_p) |
| 11230 | && w->phys_cursor_on_p | 11230 | { |
| 11231 | && y0 <= w->phys_cursor.y | 11231 | int cx0 = w->phys_cursor.x; |
| 11232 | && y1 >= w->phys_cursor.y + w->phys_cursor_height | 11232 | int cx1 = cx0 + w->phys_cursor_width; |
| 11233 | && x0 <= w->phys_cursor.x | 11233 | int cy0 = w->phys_cursor.y; |
| 11234 | && (x1 < 0 || x1 > w->phys_cursor.x)) | 11234 | int cy1 = cy0 + w->phys_cursor_height; |
| 11235 | w->phys_cursor_on_p = 0; | 11235 | |
| 11236 | if (x0 <= cx0 && (x1 < 0 || x1 >= cx1)) | ||
| 11237 | { | ||
| 11238 | /* The cursor image will be completely removed from the | ||
| 11239 | screen if the output area intersects the cursor area in | ||
| 11240 | y-direction. When we draw in [y0 y1[, and some part of | ||
| 11241 | the cursor is at y < y0, that part must have been drawn | ||
| 11242 | before. When scrolling, the cursor is erased before | ||
| 11243 | actually scrolling, so we don't come here. When not | ||
| 11244 | scrolling, the rows above the old cursor row must have | ||
| 11245 | changed, and in this case these rows must have written | ||
| 11246 | over the cursor image. Likewise if part of the cursor is | ||
| 11247 | below y1. */ | ||
| 11248 | if ((y0 >= cy0 && y0 < cy1) || (y1 >= cy0 && y1 < cy1)) | ||
| 11249 | w->phys_cursor_on_p = 0; | ||
| 11250 | } | ||
| 11251 | } | ||
| 11236 | } | 11252 | } |
| 11237 | 11253 | ||
| 11238 | 11254 | ||
| @@ -11312,6 +11328,7 @@ x_draw_hollow_cursor (w, row) | |||
| 11312 | if (cursor_glyph->type == STRETCH_GLYPH | 11328 | if (cursor_glyph->type == STRETCH_GLYPH |
| 11313 | && !x_stretch_cursor_p) | 11329 | && !x_stretch_cursor_p) |
| 11314 | wd = min (CANON_X_UNIT (f), wd); | 11330 | wd = min (CANON_X_UNIT (f), wd); |
| 11331 | w->phys_cursor_width = wd; | ||
| 11315 | 11332 | ||
| 11316 | /* The foreground of cursor_gc is typically the same as the normal | 11333 | /* The foreground of cursor_gc is typically the same as the normal |
| 11317 | background color, which can cause the cursor box to be invisible. */ | 11334 | background color, which can cause the cursor box to be invisible. */ |
| @@ -11395,7 +11412,9 @@ x_draw_bar_cursor (w, row, width, kind) | |||
| 11395 | width = f->output_data.x->cursor_width; | 11412 | width = f->output_data.x->cursor_width; |
| 11396 | width = min (cursor_glyph->pixel_width, width); | 11413 | width = min (cursor_glyph->pixel_width, width); |
| 11397 | 11414 | ||
| 11415 | w->phys_cursor_width = width; | ||
| 11398 | x_clip_to_row (w, row, gc, 0); | 11416 | x_clip_to_row (w, row, gc, 0); |
| 11417 | |||
| 11399 | if (kind == BAR_CURSOR) | 11418 | if (kind == BAR_CURSOR) |
| 11400 | XFillRectangle (dpy, window, gc, | 11419 | XFillRectangle (dpy, window, gc, |
| 11401 | WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), | 11420 | WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x), |
| @@ -11448,10 +11467,17 @@ x_draw_phys_cursor_glyph (w, row, hl) | |||
| 11448 | hl, 0); | 11467 | hl, 0); |
| 11449 | w->phys_cursor_on_p = on_p; | 11468 | w->phys_cursor_on_p = on_p; |
| 11450 | 11469 | ||
| 11470 | if (hl == DRAW_CURSOR) | ||
| 11471 | { | ||
| 11472 | struct glyph *cursor_glyph = get_phys_cursor_glyph (w); | ||
| 11473 | if (cursor_glyph) | ||
| 11474 | w->phys_cursor_width = cursor_glyph->pixel_width; | ||
| 11475 | } | ||
| 11476 | |||
| 11451 | /* When we erase the cursor, and ROW is overlapped by other | 11477 | /* When we erase the cursor, and ROW is overlapped by other |
| 11452 | rows, make sure that these overlapping parts of other rows | 11478 | rows, make sure that these overlapping parts of other rows |
| 11453 | are redrawn. */ | 11479 | are redrawn. */ |
| 11454 | if (hl == DRAW_NORMAL_TEXT && row->overlapped_p) | 11480 | else if (hl == DRAW_NORMAL_TEXT && row->overlapped_p) |
| 11455 | { | 11481 | { |
| 11456 | if (row > w->current_matrix->rows | 11482 | if (row > w->current_matrix->rows |
| 11457 | && MATRIX_ROW_OVERLAPS_SUCC_P (row - 1)) | 11483 | && MATRIX_ROW_OVERLAPS_SUCC_P (row - 1)) |
| @@ -11715,7 +11741,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11715 | w->phys_cursor.hpos = hpos; | 11741 | w->phys_cursor.hpos = hpos; |
| 11716 | w->phys_cursor.vpos = vpos; | 11742 | w->phys_cursor.vpos = vpos; |
| 11717 | w->phys_cursor_type = new_cursor_type; | 11743 | w->phys_cursor_type = new_cursor_type; |
| 11718 | w->phys_cursor_width = new_cursor_width; | ||
| 11719 | w->phys_cursor_on_p = 1; | 11744 | w->phys_cursor_on_p = 1; |
| 11720 | 11745 | ||
| 11721 | switch (new_cursor_type) | 11746 | switch (new_cursor_type) |
| @@ -11733,7 +11758,7 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11733 | break; | 11758 | break; |
| 11734 | 11759 | ||
| 11735 | case HBAR_CURSOR: | 11760 | case HBAR_CURSOR: |
| 11736 | x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR); | 11761 | x_draw_bar_cursor (w, glyph_row, new_cursor_width, HBAR_CURSOR); |
| 11737 | break; | 11762 | break; |
| 11738 | 11763 | ||
| 11739 | case NO_CURSOR: | 11764 | case NO_CURSOR: |