emacs-diffs
[Top][All Lists]
Advanced

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

master dd05eb4048: Handle pointer axes changing along with scroll valuat


From: Po Lu
Subject: master dd05eb4048: Handle pointer axes changing along with scroll valuators
Date: Sun, 15 May 2022 21:18:54 -0400 (EDT)

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

    Handle pointer axes changing along with scroll valuators
    
    * xterm.c (x_get_scroll_valuator_delta): Set valuator_return to
    NULL if no valuator was found.
    (handle_one_xevent): Assume pointer axes might've changed if no
    scroll valuator was found but valuators were set when handling
    motion events.
---
 src/xterm.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/xterm.c b/src/xterm.c
index 21c31271ca..45b756b0af 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4307,6 +4307,7 @@ x_get_scroll_valuator_delta (struct x_display_info 
*dpyinfo,
        }
     }
 
+  *valuator_return = NULL;
   return DBL_MAX;
 }
 
@@ -17507,6 +17508,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
              XIValuatorState *states;
              double *values;
              bool found_valuator = false;
+             bool other_valuators_found = false;
 #endif
              /* A fake XMotionEvent for x_note_mouse_movement. */
              XMotionEvent ev;
@@ -17564,6 +17566,12 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                                                           i, *values, &val);
                      values++;
 
+                     if (!val)
+                       {
+                         other_valuators_found = true;
+                         continue;
+                       }
+
                      if (delta != DBL_MAX)
                        {
                          if (!f)
@@ -17752,7 +17760,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
                      if (source && !NILP (source->name))
                        inev.ie.device = source->name;
 
-                     goto XI_OTHER;
+                     if (!other_valuators_found)
+                       goto XI_OTHER;
+                     else
+                       puts ("ovf");
                    }
 #ifdef HAVE_XWIDGETS
                }



reply via email to

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