From: Po Lu Date: Tue, 22 Feb 2022 06:01:31 +0000 (+0800) Subject: Always send wheel events on XI2 X-Git-Tag: emacs-29.0.90~2164 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6d060a38ec46db05598d38e577980ec8dbf7b691;p=emacs.git Always send wheel events on XI2 * src/xterm.c (handle_one_xevent): Send emulated button events as wheel events when handling XI2 button events. --- diff --git a/src/xterm.c b/src/xterm.c index 6efefd0301d..629a098b553 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)))