diff options
| author | Po Lu | 2022-01-03 11:21:16 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-03 11:21:16 +0800 |
| commit | f6501fded744b729b72ed0bbc663e5a7953b04bb (patch) | |
| tree | 1684c6fcecae85e1588e912b88fc8554d366f238 | |
| parent | 01047cf13f018f10b87788fb86efb61840a07f35 (diff) | |
| download | emacs-f6501fded744b729b72ed0bbc663e5a7953b04bb.tar.gz emacs-f6501fded744b729b72ed0bbc663e5a7953b04bb.zip | |
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.
| -rw-r--r-- | src/xterm.c | 9 |
1 files 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) | |||
| 502 | /* Return the delta of the scroll valuator VALUATOR_NUMBER under | 502 | /* Return the delta of the scroll valuator VALUATOR_NUMBER under |
| 503 | DEVICE_ID in the display DPYINFO with VALUE. The valuator's | 503 | DEVICE_ID in the display DPYINFO with VALUE. The valuator's |
| 504 | valuator will be set to VALUE afterwards. In case no scroll | 504 | valuator will be set to VALUE afterwards. In case no scroll |
| 505 | valuator is found, or if device_id is not known to Emacs, DBL_MAX | 505 | valuator is found, or if the valuator state is invalid (see the |
| 506 | is returned. Otherwise, the valuator is returned in | 506 | comment under XI_Enter in handle_one_xevent), or if device_id is |
| 507 | VALUATOR_RETURN. */ | 507 | not known to Emacs, DBL_MAX is returned. Otherwise, the valuator |
| 508 | is returned in VALUATOR_RETURN. */ | ||
| 508 | static double | 509 | static double |
| 509 | x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, | 510 | x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, |
| 510 | int valuator_number, double value, | 511 | int valuator_number, double value, |
| @@ -531,7 +532,7 @@ x_get_scroll_valuator_delta (struct x_display_info *dpyinfo, int device_id, | |||
| 531 | *valuator_return = sv; | 532 | *valuator_return = sv; |
| 532 | 533 | ||
| 533 | unblock_input (); | 534 | unblock_input (); |
| 534 | return 0.0; | 535 | return DBL_MAX; |
| 535 | } | 536 | } |
| 536 | else | 537 | else |
| 537 | { | 538 | { |