emacs-diffs
[Top][All Lists]
Advanced

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

master 6d060a38ec: Always send wheel events on XI2


From: Po Lu
Subject: master 6d060a38ec: Always send wheel events on XI2
Date: Tue, 22 Feb 2022 01:02:52 -0500 (EST)

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

    Always send wheel events on XI2
    
    * src/xterm.c (handle_one_xevent): Send emulated button events
    as wheel events when handling XI2 button events.
---
 src/xterm.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 6efefd0301..629a098b55 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11391,6 +11391,28 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
              if (f)
                {
+                 if (xev->detail >= 4 && xev->detail <= 8)
+                   {
+                     if (xev->detail <= 5)
+                       inev.ie.kind = WHEEL_EVENT;
+                     else
+                       inev.ie.kind = HORIZ_WHEEL_EVENT;
+
+                     inev.ie.timestamp = xev->time;
+
+                     XSETINT (inev.ie.x, lrint (xev->event_x));
+                     XSETINT (inev.ie.y, lrint (xev->event_y));
+                     XSETFRAME (inev.ie.frame_or_window, f);
+
+                     inev.ie.modifiers
+                       |= x_x_to_emacs_modifiers (dpyinfo,
+                                                  xev->mods.effective);
+
+                     inev.ie.modifiers |= xev->detail % 2 ? down_modifier : 
up_modifier;
+
+                     goto XI_OTHER;
+                   }
+
                  /* Is this in the tab-bar?  */
                  if (WINDOWP (f->tab_bar_window)
                      && WINDOW_TOTAL_LINES (XWINDOW (f->tab_bar_window)))



reply via email to

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