bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#65070: 29.1; (Only on Windows) Both touchpad scroll gestures scroll


From: Eli Zaretskii
Subject: bug#65070: 29.1; (Only on Windows) Both touchpad scroll gestures scroll the screen up and down.
Date: Sat, 19 Aug 2023 10:54:34 +0300

> Date: Sat, 19 Aug 2023 07:54:47 +0900
> From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
> Cc: 65070@debbugs.gnu.org,
>       hiroya.ebine1@gmail.com,
>       max@mal-richtig.de
> 
> > > I noticed that when I input wheel-down with touchpad, line count is
> > > set to negative value, which should be positive integer.
> > > 
> > > (let ((event (read-event)))
> > >   (cons (car event) (event-line-count event)))
> > > 
> > > ;; Input via touchpad
> > > (wheel-down . -3)
> > > (wheel-up . 3)
> > > 
> > > ;; Input via mouse wheel
> > > (wheel-down . 1)
> > > (wheel-up . 1)
> > 
> > Thanks.  Can you show the complete data of the events in both the
> > mouse and the touchpad cases?
> 
> ;; touchpad
> (wheel-down (#<window 62 on *scratch*> 385 (308 . 211) 300986031 nil 385 (38 
> . 9) nil (4 . 13) (8 . 22)) 1 -3 (0.0 . -79.75))
> (wheel-up (#<window 62 on *scratch*> 158 (225 . 76) 300920437 nil 158 (28 . 
> 3) nil (129 . 10) (8 . 22)) 1 3 (0.0 . 76.45))
> 
> ;; mouse wheel
> (wheel-down (#<window 62 on *scratch*> 101 (237 . 26) 300913750 nil 101 (29 . 
> 1) nil (5 . 4) (8 . 22)))
> (wheel-up (#<window 62 on *scratch*> 159 (275 . 101) 300906703 nil 159 (34 . 
> 4) nil (275 . 13) (8 . 22)))

Thanks.  Does the patch below help?

Also, can you try this with mwheel-coalesce-scroll-events set to nil
and report the events Emacs gets in that case and the effect it
produces on scrolling with the touchpad and the mouse wheel?

Po Lu, I'd appreciate if you'd take me through the code that produces
and uses these wheel events, documented in the ELisp reference manual
as (wheel-up/down POSITION CLICKS LINES PIXEL-DELTA).  Specifically:

  . what is the conventions for signs in the data of the PIXEL-DELTA
    cons cell?
  . where and how are the PIXEL-DELTA data used for scrolling?

The corresponding X code is incomprehensible for me, as it deals with
concepts and values I cannot relate to the corresponding Windows
functionalities.  (I think the xterm.c code which deals with
pixel-wise scrolling could use some detailed commentary, regardless.)
And the ELisp manual doesn't divulge enough detail, either.  So your
help will be appreciated.

diff --git a/src/w32term.c b/src/w32term.c
index 2899e82..40b04b1 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]