emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7294a28: Prevent crashes when scrolling in an unknown Window on X


From: Po Lu
Subject: master 7294a28: Prevent crashes when scrolling in an unknown Window on XI2
Date: Sat, 20 Nov 2021 07:02:20 -0500 (EST)

branch: master
commit 7294a2861d274fe61f61d182d7c74041e738fe75
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Prevent crashes when scrolling in an unknown Window on XI2
    
    * src/xterm.c (handle_one_xevent): Fix XI2 frame lookup to
    handle foreign windows.
---
 src/xterm.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index a023a5f..18f8a60 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]