aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-10-19 10:42:14 +0300
committerEli Zaretskii2019-10-19 10:42:14 +0300
commit2a3577ba11e391838f3f5dfdf48ae5a0c16b9301 (patch)
tree992a842c7dc2e06fd325306132b754f659146269 /src
parent23520fe33978030213026b5cb9be2e9ca62a31da (diff)
downloademacs-2a3577ba11e391838f3f5dfdf48ae5a0c16b9301.tar.gz
emacs-2a3577ba11e391838f3f5dfdf48ae5a0c16b9301.zip
A better fix for tab-line mouse highlight on TTY frames
* src/dispnew.c (mode_line_string): * src/xdisp.c (note_mode_line_or_margin_highlight): Remove recently-added workarounds for incorrect TTY mouse highlight: they are no longer needed. (mark_window_display_accurate_1): Set the header_line_p and tab_line_p flags of the window's current_matrix if the window displays these. (display_mode_line): Set the header_line_p and tab_line_p flags of the window's desired_matrix if the window displays these. (Bug#37807)
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c10
-rw-r--r--src/xdisp.c20
2 files changed, 10 insertions, 20 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 47bf3c26cb2..4cdc76f5bcf 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5517,15 +5517,7 @@ mode_line_string (struct window *w, enum window_part part,
5517 else if (part == ON_TAB_LINE) 5517 else if (part == ON_TAB_LINE)
5518 row = MATRIX_TAB_LINE_ROW (w->current_matrix); 5518 row = MATRIX_TAB_LINE_ROW (w->current_matrix);
5519 else 5519 else
5520 { 5520 row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
5521 row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
5522 /* On TTY frames the matrix's tab_line_p flag is not set
5523 (FIXME!), so we need to adjust by hand. */
5524 if (!FRAME_WINDOW_P (XFRAME (w->frame))
5525 && window_wants_tab_line (w))
5526
5527 row++;
5528 }
5529 y0 = *y - row->y; 5521 y0 = *y - row->y;
5530 *y = row - MATRIX_FIRST_TEXT_ROW (w->current_matrix); 5522 *y = row - MATRIX_FIRST_TEXT_ROW (w->current_matrix);
5531 5523
diff --git a/src/xdisp.c b/src/xdisp.c
index 0d8f9a1edd5..8cbda08efc5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -15988,6 +15988,8 @@ mark_window_display_accurate_1 (struct window *w, bool accurate_p)
15988 w->current_matrix->buffer = b; 15988 w->current_matrix->buffer = b;
15989 w->current_matrix->begv = BUF_BEGV (b); 15989 w->current_matrix->begv = BUF_BEGV (b);
15990 w->current_matrix->zv = BUF_ZV (b); 15990 w->current_matrix->zv = BUF_ZV (b);
15991 w->current_matrix->header_line_p = window_wants_header_line (w);
15992 w->current_matrix->tab_line_p = window_wants_tab_line (w);
15991 15993
15992 w->last_cursor_vpos = w->cursor.vpos; 15994 w->last_cursor_vpos = w->cursor.vpos;
15993 w->last_cursor_off_p = w->cursor_off_p; 15995 w->last_cursor_off_p = w->cursor_off_p;
@@ -24947,7 +24949,12 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
24947 24949
24948 it.glyph_row->mode_line_p = true; 24950 it.glyph_row->mode_line_p = true;
24949 if (face_id == TAB_LINE_FACE_ID) 24951 if (face_id == TAB_LINE_FACE_ID)
24950 it.glyph_row->tab_line_p = true; 24952 {
24953 it.glyph_row->tab_line_p = true;
24954 w->desired_matrix->tab_line_p = true;
24955 }
24956 else if (face_id == HEADER_LINE_FACE_ID)
24957 w->desired_matrix->header_line_p = true;
24951 24958
24952 /* FIXME: This should be controlled by a user option. But 24959 /* FIXME: This should be controlled by a user option. But
24953 supporting such an option is not trivial, since the mode line is 24960 supporting such an option is not trivial, since the mode line is
@@ -32488,11 +32495,6 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
32488 ? MATRIX_TAB_LINE_ROW (w->current_matrix) 32495 ? MATRIX_TAB_LINE_ROW (w->current_matrix)
32489 : MATRIX_HEADER_LINE_ROW (w->current_matrix))); 32496 : MATRIX_HEADER_LINE_ROW (w->current_matrix)));
32490 32497
32491 /* On TTY frames the matrix's tab_line_p flag is not set
32492 (FIXME!), so we need to adjust by hand. */
32493 if (!FRAME_WINDOW_P (f) && area == ON_HEADER_LINE
32494 && window_wants_tab_line (w))
32495 row++;
32496 /* Find the glyph under the mouse pointer. */ 32498 /* Find the glyph under the mouse pointer. */
32497 if (row->mode_line_p && row->enabled_p) 32499 if (row->mode_line_p && row->enabled_p)
32498 { 32500 {
@@ -32707,11 +32709,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
32707 ? (w->current_matrix)->nrows - 1 32709 ? (w->current_matrix)->nrows - 1
32708 : (area == ON_TAB_LINE 32710 : (area == ON_TAB_LINE
32709 ? 0 32711 ? 0
32710 : ((w->current_matrix->tab_line_p 32712 : (w->current_matrix->tab_line_p
32711 /* The window_wants_tab_line test is for TTY
32712 frames where the tab_line_p flag is not
32713 set (FIXME!). */
32714 || window_wants_tab_line (w))
32715 ? 1 32713 ? 1
32716 : 0))); 32714 : 0)));
32717 32715