aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2021-11-29 15:36:15 +0800
committerPo Lu2021-11-29 15:37:41 +0800
commit618070d4b414c20f19a1f873ffb1d7015743599e (patch)
treef984709d4e0d906c060008b7aad45dca697dbe1e /src
parenta1aa9cbf57a08f1c17b92b13a2bf07d504684fcc (diff)
downloademacs-618070d4b414c20f19a1f873ffb1d7015743599e.tar.gz
emacs-618070d4b414c20f19a1f873ffb1d7015743599e.zip
Allow customizing the pixel delta of wheel events on X
* lisp/cus-start.el: Add `x-scroll-event-delta-factor'. * src/xterm.c (handle_one_xevent): Apply scroll event delta factor to wheel events with pixel data. (Vx_scroll_event_delta_factor): New user option.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 253e0eb20b0..a6d9c8c7a1b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10045,6 +10045,9 @@ handle_one_xevent (struct x_display_info *dpyinfo,
10045 10045
10046 scroll_unit = pow (FRAME_PIXEL_HEIGHT (f), 2.0 / 3.0); 10046 scroll_unit = pow (FRAME_PIXEL_HEIGHT (f), 2.0 / 3.0);
10047 10047
10048 if (FLOATP (Vx_scroll_event_delta_factor))
10049 scroll_unit *= XFLOAT_DATA (Vx_scroll_event_delta_factor);
10050
10048 if (val->horizontal) 10051 if (val->horizontal)
10049 { 10052 {
10050 inev.ie.arg 10053 inev.ie.arg
@@ -15217,4 +15220,10 @@ Otherwise, a wheel event will be sent every time the mouse wheel is
15217moved. This option is only effective when Emacs is built with XInput 15220moved. This option is only effective when Emacs is built with XInput
152182, with Haiku windowing support, or with NS. */); 152212, with Haiku windowing support, or with NS. */);
15219 x_coalesce_scroll_events = true; 15222 x_coalesce_scroll_events = true;
15223
15224 DEFVAR_LISP ("x-scroll-event-delta-factor", Vx_scroll_event_delta_factor,
15225 doc: /* A scale to apply to pixel deltas reported in scroll events.
15226This option is only effective when Emacs is built with XInput 2
15227support. */);
15228 Vx_scroll_event_delta_factor = make_float (1.0);
15220} 15229}