emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2c9128c: Fix mouse highlight with tab-line on TTY f


From: Eli Zaretskii
Subject: [Emacs-diffs] master 2c9128c: Fix mouse highlight with tab-line on TTY frames
Date: Fri, 18 Oct 2019 11:49:34 -0400 (EDT)

branch: master
commit 2c9128ce1352d8098d6bbd43d081a0fb07cfff8f
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix mouse highlight with tab-line on TTY frames
    
    * src/xdisp.c (note_mode_line_or_margin_highlight):
    * src/dispnew.c (mode_line_string): Fix mouse highlight on TTY
    frames when both header line and tab-line are displayed.
    (Bug#37807)
---
 src/dispnew.c | 10 +++++++++-
 src/xdisp.c   | 11 ++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/dispnew.c b/src/dispnew.c
index 4cdc76f..47bf3c2 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5517,7 +5517,15 @@ mode_line_string (struct window *w, enum window_part 
part,
   else if (part == ON_TAB_LINE)
     row = MATRIX_TAB_LINE_ROW (w->current_matrix);
   else
-    row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
+    {
+      row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
+      /* On TTY frames the matrix's tab_line_p flag is not set
+        (FIXME!), so we need to adjust by hand.  */
+      if (!FRAME_WINDOW_P (XFRAME (w->frame))
+         && window_wants_tab_line (w))
+
+       row++;
+    }
   y0 = *y - row->y;
   *y = row - MATRIX_FIRST_TEXT_ROW (w->current_matrix);
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 30be492..457fa43 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32492,6 +32492,11 @@ note_mode_line_or_margin_highlight (Lisp_Object 
window, int x, int y,
                ? MATRIX_TAB_LINE_ROW (w->current_matrix)
                : MATRIX_HEADER_LINE_ROW (w->current_matrix)));
 
+      /* On TTY frames the matrix's tab_line_p flag is not set
+        (FIXME!), so we need to adjust by hand.  */
+      if (!FRAME_WINDOW_P (f) && area == ON_HEADER_LINE
+         && window_wants_tab_line (w))
+       row++;
       /* Find the glyph under the mouse pointer.  */
       if (row->mode_line_p && row->enabled_p)
        {
@@ -32706,7 +32711,11 @@ note_mode_line_or_margin_highlight (Lisp_Object 
window, int x, int y,
                  ? (w->current_matrix)->nrows - 1
                  : (area == ON_TAB_LINE
                     ? 0
-                    : (w->current_matrix->tab_line_p
+                    : ((w->current_matrix->tab_line_p
+                        /* The window_wants_tab_line test is for TTY
+                           frames where the tab_line_p flag is not
+                           set (FIXME!).  */
+                        || window_wants_tab_line (w))
                        ? 1
                        : 0)));
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]