]> git.eshelyaron.com Git - emacs.git/commitdiff
Always send wheel events on XI2
authorPo Lu <luangruo@yahoo.com>
Tue, 22 Feb 2022 06:01:31 +0000 (14:01 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 22 Feb 2022 06:02:41 +0000 (14:02 +0800)
* src/xterm.c (handle_one_xevent): Send emulated button events
as wheel events when handling XI2 button events.

src/xterm.c

index 6efefd0301df509aa4f2784e2e0af2b00a7dbbce..629a098b553b62ac1011c7284b3f374f46e7cb60 100644 (file)
@@ -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)))