emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 781ddd7e7d8: Fix touchpad scrolling on MS-Windows


From: Eli Zaretskii
Subject: emacs-29 781ddd7e7d8: Fix touchpad scrolling on MS-Windows
Date: Sat, 19 Aug 2023 10:02:24 -0400 (EDT)

branch: emacs-29
commit 781ddd7e7d87de150d74d6d8615c25e68b42275b
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix touchpad scrolling on MS-Windows
    
    * src/w32term.c (w32_construct_mouse_wheel): The number of lines
    to scroll should always be positive in wheel-scroll events.
    Whether to scroll up or down is encoded in the modifiers, which
    produce either wheel-up or wheel-down event.  (Bug#65070)
    
    * doc/lispref/commands.texi (Misc Events): Clarify the
    documentation of 'wheel-up' and 'wheel-down' events.
---
 doc/lispref/commands.texi | 11 ++++++-----
 src/w32term.c             |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index 0298a5d77ee..028209b2bc1 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -2249,11 +2249,12 @@ occurred.
 
 @var{clicks}, if present, is the number of times that the wheel was
 moved in quick succession.  @xref{Repeat Events}.  @var{lines}, if
-present and not @code{nil}, is the number of screen lines that should
-be scrolled.  @var{pixel-delta}, if present, is a cons cell of the
-form @w{@code{(@var{x} . @var{y})}}, where @var{x} and @var{y} are the
-numbers of pixels by which to scroll in each axis, a.k.a.@:
-@dfn{pixelwise deltas}.
+present and not @code{nil}, is the positive number of screen lines
+that should be scrolled (either up, when the event is @code{wheel-up},
+or down when the event is @code{wheel-down}).  @var{pixel-delta}, if
+present, is a cons cell of the form @w{@code{(@var{x} . @var{y})}},
+where @var{x} and @var{y} are the numbers of pixels by which to scroll
+in each axis, a.k.a.@: @dfn{pixelwise deltas}.
 
 @cindex pixel-resolution wheel events
 You can use these @var{x} and @var{y} pixelwise deltas to determine
diff --git a/src/w32term.c b/src/w32term.c
index 2899e82b295..40b04b15993 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3412,7 +3412,7 @@ w32_construct_mouse_wheel (struct input_event *result, 
W32Msg *msg,
            ((double)FRAME_LINE_HEIGHT (f) * scroll_unit)
            / ((double)WHEEL_DELTA / delta);
       nlines = value_to_report / FRAME_LINE_HEIGHT (f) + 0.5;
-      result->arg = list3 (make_fixnum (nlines),
+      result->arg = list3 (make_fixnum (eabs (nlines)),
                           make_float (0.0),
                           make_float (value_to_report));
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]