From 8f652465238aff062851a1f8bf1d76f5503ac1a9 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 16 Jan 2022 21:39:14 +0800 Subject: [PATCH] Fix XI2 event filtering for very old versions of libXi * src/xterm.c (handle_one_xevent): Handle cases where xev->display is NULL. --- src/xterm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 4b5358ed658..3328e659301 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10711,7 +10711,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (f && xev->evtype == XI_ButtonPress && !popup_activated () - && !x_window_to_scroll_bar (xev->display, xev->event, 2) + && !x_window_to_scroll_bar (dpyinfo->display, xev->event, 2) && !FRAME_NO_ACCEPT_FOCUS (f)) { /* When clicking into a child frame or when clicking @@ -10884,7 +10884,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, xkey.type = KeyPress; xkey.serial = xev->serial; xkey.send_event = xev->send_event; - xkey.display = xev->display; + xkey.display = dpyinfo->display; xkey.window = xev->event; xkey.root = xev->root; xkey.subwindow = xev->child; @@ -11230,7 +11230,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, xkey.type = KeyRelease; xkey.serial = xev->serial; xkey.send_event = xev->send_event; - xkey.display = xev->display; + xkey.display = dpyinfo->display; xkey.window = xev->event; xkey.root = xev->root; xkey.subwindow = xev->child; -- 2.39.2