From a61cc138edeee269e8cf62c13058d5258310d7bc Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 1 Nov 2023 11:15:24 +0800 Subject: [PATCH] Prevent errors when generating events above menu bar windows * src/keyboard.c (make_lispy_position): Pass false to w_f_c, for the subsequent code is not prepared to encounter menu bar windows. --- src/keyboard.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index c00f48d7836..003340c3e58 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5561,9 +5561,10 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, /* Coordinate pixel positions to return. */ int xret = 0, yret = 0; /* The window or frame under frame pixel coordinates (x,y) */ - Lisp_Object window_or_frame = f - ? window_from_coordinates (f, mx, my, &part, true, true, true) - : Qnil; + Lisp_Object window_or_frame = (f != NULL + ? window_from_coordinates (f, mx, my, &part, + false, true, true) + : Qnil); #ifdef HAVE_WINDOW_SYSTEM bool tool_bar_p = false; bool menu_bar_p = false; -- 2.39.2