]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/term.c (tty_frame_at, term_mouse_position): Fix last change.
authorEli Zaretskii <eliz@gnu.org>
Sat, 11 Jan 2025 16:39:19 +0000 (18:39 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 Jan 2025 10:59:01 +0000 (11:59 +0100)
(cherry picked from commit 912310285860363f7cf9032e949124b93a51dbca)

src/term.c

index 10380eba4b90d05735d85f91719bc3a67ed94ea4..b8894844c6c9e543e80391b95582a69cc92b4c4d 100644 (file)
@@ -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;