From 20dd24c3a058d85f5e92311038fe4f561f00bf8f Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Tue, 16 Nov 2021 01:19:12 +0900 Subject: [PATCH] Avoid handle terminal frames in pgtk_mouse_position. Just above, f1 can become a selected frame, which may be a terminal frame. We can't call gtk_widget_get_window() for a terminal frame. * src/pgtkterm.c (pgtk_mouse_position): Return if it is not a pgtk frame. --- src/pgtkterm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 0d258584c53..5d39276a884 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -3350,6 +3350,13 @@ pgtk_mouse_position (struct frame **fp, int insist, Lisp_Object * bar_window, } } + /* f1 can be a terminal frame. */ + if (f1 == NULL || !FRAME_PGTK_P (f1)) + { + unblock_input (); + return; + } + /* 2. get the display and the device. */ win = gtk_widget_get_window (FRAME_GTK_WIDGET (f1)); GdkDisplay *gdpy = gdk_window_get_display (win); -- 2.39.5