emacs-diffs
[Top][All Lists]
Advanced

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

master 463300d 1/2: Enable TTY mouse-face support when built without GPM


From: Eli Zaretskii
Subject: master 463300d 1/2: Enable TTY mouse-face support when built without GPM support
Date: Fri, 22 Jan 2021 07:17:42 -0500 (EST)

branch: master
commit 463300d431a56c58ca7f1db9615046143f354a81
Author: João Távora <joaotavora@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Enable TTY mouse-face support when built without GPM support
    
    * src/term.c (tty_write_glyphs_with_face): Move definition out of
    ifdef block.
    * src/xdisp.c (draw_row_with_mouse_face): Now called
    unconditionally on all platforms.
---
 src/term.c  | 35 ++++++++++++++++-------------------
 src/xdisp.c |  3 +--
 2 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/src/term.c b/src/term.c
index 2e2ab2b..37c06a5 100644
--- a/src/term.c
+++ b/src/term.c
@@ -790,8 +790,6 @@ tty_write_glyphs (struct frame *f, struct glyph *string, 
int len)
   cmcheckmagic (tty);
 }
 
-#ifdef HAVE_GPM                        /* Only used by GPM code.  */
-
 static void
 tty_write_glyphs_with_face (register struct frame *f, register struct glyph 
*string,
                            register int len, register int face_id)
@@ -847,7 +845,6 @@ tty_write_glyphs_with_face (register struct frame *f, 
register struct glyph *str
 
   cmcheckmagic (tty);
 }
-#endif
 
 /* An implementation of insert_glyphs for termcap frames. */
 
@@ -2380,22 +2377,6 @@ frame's terminal). */)
                               Mouse
  ***********************************************************************/
 
-#ifdef HAVE_GPM
-
-void
-term_mouse_moveto (int x, int y)
-{
-  /* TODO: how to set mouse position?
-  const char *name;
-  int fd;
-  name = (const char *) ttyname (0);
-  fd = emacs_open (name, O_WRONLY, 0);
-     SOME_FUNCTION (x, y, fd);
-  emacs_close (fd);
-  last_mouse_x = x;
-  last_mouse_y = y;  */
-}
-
 /* Implementation of draw_row_with_mouse_face for TTY/GPM.  */
 void
 tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row,
@@ -2428,6 +2409,22 @@ tty_draw_row_with_mouse_face (struct window *w, struct 
glyph_row *row,
   cursor_to (f, save_y, save_x);
 }
 
+#ifdef HAVE_GPM
+
+void
+term_mouse_moveto (int x, int y)
+{
+  /* TODO: how to set mouse position?
+  const char *name;
+  int fd;
+  name = (const char *) ttyname (0);
+  fd = emacs_open (name, O_WRONLY, 0);
+     SOME_FUNCTION (x, y, fd);
+  emacs_close (fd);
+  last_mouse_x = x;
+  last_mouse_y = y;  */
+}
+
 /* Return the current time, as a Time value.  Wrap around on overflow.  */
 static Time
 current_Time (void)
diff --git a/src/xdisp.c b/src/xdisp.c
index 32e9773..e1e4ff4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -31927,9 +31927,8 @@ draw_row_with_mouse_face (struct window *w, int 
start_x, struct glyph_row *row,
       return;
     }
 #endif
-#if defined (HAVE_GPM) || defined (MSDOS) || defined (WINDOWSNT)
+
   tty_draw_row_with_mouse_face (w, row, start_hpos, end_hpos, draw);
-#endif
 }
 
 /* Display the active region described by mouse_face_* according to DRAW.  */



reply via email to

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