From a970a2a48926d2eca0b767d01c809fbebdc320d7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 14 Jan 2022 17:43:09 +0800 Subject: [PATCH] Make sure the X mouse position hook always looks at an X frame * src/xterm.c (XTmouse_position): Check that f1 is an X frame. --- src/xterm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 3a9f5c9ef9f..d17eaf0cccf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5923,7 +5923,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, if (!f1 && insist > 0) f1 = SELECTED_FRAME (); - if (f1) + if (f1 && FRAME_X_P (f1)) { /* Ok, we found a frame. Store all the values. last_mouse_glyph is a rectangle used to reduce the @@ -5933,7 +5933,6 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, on it, i.e. into the same rectangles that matrices on the frame are divided into. */ - /* FIXME: what if F1 is not an X frame? */ dpyinfo = FRAME_DISPLAY_INFO (f1); remember_mouse_glyph (f1, win_x, win_y, &dpyinfo->last_mouse_glyph); dpyinfo->last_mouse_glyph_frame = f1; -- 2.39.2