summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2021-01-16 14:17:58 -0800
committerEli Zaretskii <eliz@gnu.org>2021-01-22 14:05:21 +0200
commit463300d431a56c58ca7f1db9615046143f354a81 (patch)
tree576ebf6115de5696d2ab1d2292147736fdef2ef8 /src
parent6bfc672bc7f467edf39cfba262c5c4f11897d4e0 (diff)
downloademacs-463300d431a56c58ca7f1db9615046143f354a81.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/term.c35
-rw-r--r--src/xdisp.c3
2 files changed, 17 insertions, 21 deletions
diff --git a/src/term.c b/src/term.c
index 2e2ab2bf438..37c06a560dd 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 32e9773b54e..e1e4ff41365 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. */