Commit 7294a286 authored by Po Lu's avatar Po Lu
Browse files

Prevent crashes when scrolling in an unknown Window on XI2

* src/xterm.c (handle_one_xevent): Fix XI2 frame lookup to
handle foreign windows.
parent 3b68662a
Pipeline #14066 failed with stages
in 86 minutes and 54 seconds
......@@ -9939,7 +9939,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (delta != DBL_MAX)
{
f = mouse_or_wdesc_frame (dpyinfo, xev->event);
if (!f)
{
f = x_any_window_to_frame (dpyinfo, xev->event);
if (!f)
goto XI_OTHER;
}
scroll_unit = pow (FRAME_PIXEL_HEIGHT (f), 2.0 / 3.0);
found_valuator = true;
......@@ -9952,14 +9959,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
&& (fabs (val->emacs_value) < 1))
continue;
if (!f)
{
f = x_any_window_to_frame (dpyinfo, xev->event);
if (!f)
goto XI_OTHER;
}
bool s = signbit (val->emacs_value);
inev.ie.kind = (val->horizontal
? HORIZ_WHEEL_EVENT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment