From 2bbf62cbf66c5f6d093dfba5d26f357deb7a1132 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 27 Jan 2025 09:11:21 +0800 Subject: [PATCH] Fix the Android port * src/term.c (tty_frame_at) [HAVE_ANDROID]: Always return nil. * src/terminal.c (cursor_to, raw_cursor_to) [HAVE_ANDROID]: Don't call root_xy. (cherry picked from commit 8d11871c63e65459fd14f1cbe08bf0460c452ac6) --- src/term.c | 2 ++ src/terminal.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/term.c b/src/term.c index 777ab5f918c..e519813c7ac 100644 --- a/src/term.c +++ b/src/term.c @@ -2597,6 +2597,7 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, static Lisp_Object tty_frame_at (int x, int y, int *cx, int *cy) { +#ifndef HAVE_ANDROID for (Lisp_Object frames = Ftty_frame_list_z_order (Qnil); !NILP (frames); frames = Fcdr (frames)) @@ -2613,6 +2614,7 @@ tty_frame_at (int x, int y, int *cx, int *cy) return frame; } } +#endif /* !HAVE_ANDROID */ return Qnil; } diff --git a/src/terminal.c b/src/terminal.c index 17dc4770ef7..668b8845029 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -114,7 +114,11 @@ cursor_to (struct frame *f, int vpos, int hpos) if (term->cursor_to_hook) { int x, y; +#ifndef HAVE_ANDROID root_xy (f, hpos, vpos, &x, &y); +#else /* HAVE_ANDROID */ + x = hpos, y = vpos; +#endif /* !HAVE_ANDROID */ term->cursor_to_hook (f, y, x); } } @@ -128,7 +132,11 @@ raw_cursor_to (struct frame *f, int row, int col) if (term->raw_cursor_to_hook) { int x, y; +#ifndef HAVE_ANDROID root_xy (f, col, row, &x, &y); +#else /* HAVE_ANDROID */ + x = col, y = row; +#endif /* !HAVE_ANDROID */ term->raw_cursor_to_hook (f, y, x); } } -- 2.39.5