From: Po Lu Date: Mon, 3 Jan 2022 03:21:16 +0000 (+0800) Subject: Don't try to guess a delta if a scroll valuator's state is unknown X-Git-Tag: emacs-29.0.90~3290 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f6501fded744b729b72ed0bbc663e5a7953b04bb;p=emacs.git 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. --- 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 {