diff options
| author | Gerd Moellmann | 2002-04-26 17:56:03 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2002-04-26 17:56:03 +0000 |
| commit | 56a0382c7d97daed488241a6fafff66641bf0fae (patch) | |
| tree | 98389d6cb817973b71f2456fd0bdcab482ad7570 /src | |
| parent | 6cc6a2e95b45c8f3159647c2df53442d4f19129d (diff) | |
| download | emacs-56a0382c7d97daed488241a6fafff66641bf0fae.tar.gz emacs-56a0382c7d97daed488241a6fafff66641bf0fae.zip | |
(x_draw_phys_cursor_glyph): Undo last change. Compute
phys_cursor_width from the x position returned by x_draw_glyhs,
which is cheaper.
(x_display_and_set_cursor): Compute the buffer-local value
of `cursor-in-non-selected-windows' only when needed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/xterm.c | 38 |
2 files changed, 23 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f85358a4f7b..990f10d02ec 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2002-04-26 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * xterm.c (x_draw_phys_cursor_glyph): Undo last change. Compute | ||
| 4 | phys_cursor_width from the x position returned by x_draw_glyhs, | ||
| 5 | which is cheaper. | ||
| 6 | (x_display_and_set_cursor): Compute the buffer-local value | ||
| 7 | of `cursor-in-non-selected-windows' only when needed. | ||
| 8 | |||
| 1 | 2002-04-25 Gerd Moellmann <gerd@gnu.org> | 9 | 2002-04-25 Gerd Moellmann <gerd@gnu.org> |
| 2 | 10 | ||
| 3 | * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box | 11 | * xterm.c (x_draw_phys_cursor_glyph): Take into account that a box |
diff --git a/src/xterm.c b/src/xterm.c index 1f9e863d427..9a184fb8840 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11468,24 +11468,15 @@ x_draw_phys_cursor_glyph (w, row, hl) | |||
| 11468 | if (w->phys_cursor.hpos < row->used[TEXT_AREA]) | 11468 | if (w->phys_cursor.hpos < row->used[TEXT_AREA]) |
| 11469 | { | 11469 | { |
| 11470 | int on_p = w->phys_cursor_on_p; | 11470 | int on_p = w->phys_cursor_on_p; |
| 11471 | int x1; | ||
| 11471 | 11472 | ||
| 11472 | x_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, | 11473 | x1 = x_draw_glyphs (w, w->phys_cursor.x, row, TEXT_AREA, |
| 11473 | w->phys_cursor.hpos, w->phys_cursor.hpos + 1, | 11474 | w->phys_cursor.hpos, w->phys_cursor.hpos + 1, |
| 11474 | hl, 0); | 11475 | hl, 0); |
| 11475 | w->phys_cursor_on_p = on_p; | 11476 | w->phys_cursor_on_p = on_p; |
| 11476 | 11477 | ||
| 11477 | if (hl == DRAW_CURSOR) | 11478 | if (hl == DRAW_CURSOR) |
| 11478 | { | 11479 | w->phys_cursor_width = x1 - w->phys_cursor.x; |
| 11479 | struct glyph *cursor_glyph = get_phys_cursor_glyph (w); | ||
| 11480 | if (cursor_glyph) | ||
| 11481 | { | ||
| 11482 | if (x_stretch_cursor_p) | ||
| 11483 | w->phys_cursor_width = cursor_glyph->pixel_width; | ||
| 11484 | else | ||
| 11485 | w->phys_cursor_width = min (CANON_X_UNIT (XFRAME (w->frame)), | ||
| 11486 | cursor_glyph->pixel_width); | ||
| 11487 | } | ||
| 11488 | } | ||
| 11489 | 11480 | ||
| 11490 | /* When we erase the cursor, and ROW is overlapped by other | 11481 | /* When we erase the cursor, and ROW is overlapped by other |
| 11491 | rows, make sure that these overlapping parts of other rows | 11482 | rows, make sure that these overlapping parts of other rows |
| @@ -11644,7 +11635,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11644 | struct glyph_matrix *current_glyphs; | 11635 | struct glyph_matrix *current_glyphs; |
| 11645 | struct glyph_row *glyph_row; | 11636 | struct glyph_row *glyph_row; |
| 11646 | struct glyph *glyph; | 11637 | struct glyph *glyph; |
| 11647 | int cursor_non_selected; | ||
| 11648 | 11638 | ||
| 11649 | /* This is pointless on invisible frames, and dangerous on garbaged | 11639 | /* This is pointless on invisible frames, and dangerous on garbaged |
| 11650 | windows and frames; in the latter case, the frame or window may | 11640 | windows and frames; in the latter case, the frame or window may |
| @@ -11680,9 +11670,6 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11680 | the cursor type given by the frame parameter. If explicitly | 11670 | the cursor type given by the frame parameter. If explicitly |
| 11681 | marked off, draw no cursor. In all other cases, we want a hollow | 11671 | marked off, draw no cursor. In all other cases, we want a hollow |
| 11682 | box cursor. */ | 11672 | box cursor. */ |
| 11683 | cursor_non_selected | ||
| 11684 | = !NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows, | ||
| 11685 | w->buffer)); | ||
| 11686 | new_cursor_width = -1; | 11673 | new_cursor_width = -1; |
| 11687 | if (cursor_in_echo_area | 11674 | if (cursor_in_echo_area |
| 11688 | && FRAME_HAS_MINIBUF_P (f) | 11675 | && FRAME_HAS_MINIBUF_P (f) |
| @@ -11690,7 +11677,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11690 | { | 11677 | { |
| 11691 | if (w == XWINDOW (echo_area_window)) | 11678 | if (w == XWINDOW (echo_area_window)) |
| 11692 | new_cursor_type = FRAME_DESIRED_CURSOR (f); | 11679 | new_cursor_type = FRAME_DESIRED_CURSOR (f); |
| 11693 | else if (cursor_non_selected) | 11680 | else if (!NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows, |
| 11681 | w->buffer))) | ||
| 11694 | new_cursor_type = HOLLOW_BOX_CURSOR; | 11682 | new_cursor_type = HOLLOW_BOX_CURSOR; |
| 11695 | else | 11683 | else |
| 11696 | new_cursor_type = NO_CURSOR; | 11684 | new_cursor_type = NO_CURSOR; |
| @@ -11701,7 +11689,8 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11701 | || w != XWINDOW (f->selected_window)) | 11689 | || w != XWINDOW (f->selected_window)) |
| 11702 | { | 11690 | { |
| 11703 | if ((MINI_WINDOW_P (w) && minibuf_level == 0) | 11691 | if ((MINI_WINDOW_P (w) && minibuf_level == 0) |
| 11704 | || !cursor_non_selected | 11692 | || NILP (Fbuffer_local_value (Qcursor_in_non_selected_windows, |
| 11693 | w->buffer)) | ||
| 11705 | || NILP (XBUFFER (w->buffer)->cursor_type)) | 11694 | || NILP (XBUFFER (w->buffer)->cursor_type)) |
| 11706 | new_cursor_type = NO_CURSOR; | 11695 | new_cursor_type = NO_CURSOR; |
| 11707 | else | 11696 | else |
| @@ -11740,9 +11729,12 @@ x_display_and_set_cursor (w, on, hpos, vpos, x, y) | |||
| 11740 | && new_cursor_width != w->phys_cursor_width))) | 11729 | && new_cursor_width != w->phys_cursor_width))) |
| 11741 | x_erase_phys_cursor (w); | 11730 | x_erase_phys_cursor (w); |
| 11742 | 11731 | ||
| 11743 | /* If the cursor is now invisible and we want it to be visible, | 11732 | /* Don't check phys_cursor_on_p here because that flag is only set |
| 11744 | display it. */ | 11733 | to zero in some cases where we know that the cursor has been |
| 11745 | if (on && !w->phys_cursor_on_p) | 11734 | completely erased, to avoid the extra work of erasing the cursor |
| 11735 | twice. In other words, phys_cursor_on_p can be 1 and the cursor | ||
| 11736 | still not be visible, or it has only been partly erased. */ | ||
| 11737 | if (on) | ||
| 11746 | { | 11738 | { |
| 11747 | w->phys_cursor_ascent = glyph_row->ascent; | 11739 | w->phys_cursor_ascent = glyph_row->ascent; |
| 11748 | w->phys_cursor_height = glyph_row->height; | 11740 | w->phys_cursor_height = glyph_row->height; |