From: Yuuki Harano Date: Mon, 15 Nov 2021 16:19:12 +0000 (+0900) Subject: Avoid handle terminal frames in pgtk_mouse_position. X-Git-Tag: emacs-29.0.90~3660 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20dd24c3a058d85f5e92311038fe4f561f00bf8f;p=emacs.git 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. --- 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);