[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f6501fded7 2/2: Don't try to guess a delta if a scroll valuator's
From: |
Po Lu |
Subject: |
master f6501fded7 2/2: Don't try to guess a delta if a scroll valuator's state is unknown |
Date: |
Sun, 2 Jan 2022 22:22:15 -0500 (EST) |
branch: master
commit f6501fded744b729b72ed0bbc663e5a7953b04bb
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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 c9120638a7..31e39280b3 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
{