From: Eli Zaretskii Date: Sat, 11 Jan 2025 16:39:19 +0000 (+0200) Subject: ; * src/term.c (tty_frame_at, term_mouse_position): Fix last change. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2d4faa2a72e239e118ae1d199db7df3f49805b19;p=emacs.git ; * src/term.c (tty_frame_at, term_mouse_position): Fix last change. (cherry picked from commit 912310285860363f7cf9032e949124b93a51dbca) --- diff --git a/src/term.c b/src/term.c index 10380eba4b9..b8894844c6c 100644 --- a/src/term.c +++ b/src/term.c @@ -2597,7 +2597,8 @@ tty_draw_row_with_mouse_face (struct window *w, struct glyph_row *row, static Lisp_Object tty_frame_at (int x, int y) { - for (Lisp_Object frames = Ftty_frame_list_z_order (Qnil); frames != Qnil; + for (Lisp_Object frames = Ftty_frame_list_z_order (Qnil); + !NILP (frames); frames = Fcdr (frames)) { Lisp_Object frame = Fcar (frames); @@ -2670,10 +2671,13 @@ term_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, { /* If we've gotten no GPM mouse events yet, last_mouse_frame won't be set. Perhaps `gpm-mouse-mode' was never active. */ - if (! FRAMEP (last_mouse_frame)) + if (!FRAMEP (last_mouse_frame)) return; *fp = XFRAME (last_mouse_frame); + if (!FRAME_LIVE_P (fp)) + return; + (*fp)->mouse_moved = 0; *bar_window = Qnil;