From f6501fded744b729b72ed0bbc663e5a7953b04bb Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 3 Jan 2022 11:21:16 +0800 Subject: [PATCH] Don't try to guess a delta if a scroll valuator's state is unknown * src/xterm.c (x_get_scroll_valuator_delta): Return DBL_MAX if the scroll valuator's value is unknown. --- src/xterm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index c9120638a73..31e39280b36 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -502,9 +502,10 @@ x_init_master_valuators (struct x_display_info *dpyinfo) /* Return the delta of the scroll valuator VALUATOR_NUMBER under DEVICE_ID in the display DPYINFO with VALUE. The valuator's valuator will be set to VALUE afterwards. In case no scroll - valuator is found, or if device_id is not known to Emacs, DBL_MAX - is returned. Otherwise, the valuator is returned in - VALUATOR_RETURN. */ + valuator is found, or if the valuator state is invalid (see the + comment under XI_Enter in handle_one_xevent), or if device_id is + not known to Emacs, DBL_MAX is returned. Otherwise, the valuator + is returned in VALUATOR_RETURN. */ static double x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, int valuator_number, double value, @@ -531,7 +532,7 @@ x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, *valuator_return = sv; unblock_input (); - return 0.0; + return DBL_MAX; } else { -- 2.39.5