diff options
author | Po Lu <luangruo@yahoo.com> | 2022-02-22 14:01:31 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-02-22 14:02:41 +0800 |
commit | 6d060a38ec46db05598d38e577980ec8dbf7b691 (patch) | |
tree | e3e242cf368f3c6fd3b006d9e1248b63acb46812 | |
parent | bee54495e92ddf5d75e3f68ac7e823b221306719 (diff) | |
download | emacs-6d060a38ec46db05598d38e577980ec8dbf7b691.tar.gz |
Always send wheel events on XI2
* src/xterm.c (handle_one_xevent): Send emulated button events
as wheel events when handling XI2 button events.
-rw-r--r-- | src/xterm.c | 22 |
1 files changed, 22 insertions, 0 deletions
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))) |