Subject: Re: bug#65360: emacs 29.1 with MSYS2: vertical scrolling with touchpad not working

From: Vincent Torri <[email-masked]>
Date: Fri, 18 Aug 2023 21:47:10 +0200

On Fri, Aug 18, 2023 at 9:01 AM Vincent Torri <[email-masked]> wrote:
>
> On Fri, Aug 18, 2023 at 8:56 AM Eli Zaretskii <[email-masked]> wrote:
> >
> > > From: Vincent Torri <[email-masked]>
> > > Date: Fri, 18 Aug 2023 08:41:05 +0200
> > > Cc: [email-masked]
> > >
> > > maybe it will be simpler for me to compile emacs and debug it directly
> > > with some printf(). At least i know where to look at now
> >
> > That can also be done, with the caveats that:
> >
> >   . to look at some variable, you will have to add code and recompile
> >     Emacs
>
> normally, make will recompile only what is needed, one file
>
> >   . if the function(s) in question are invoked frequently when you
> >     scroll, you will have a lot of output, without a good way of
> >     knowing which output was caused by which UI gesture
>
> well, there will not a lot of output : just scrolling once to the
> bottom is problematic
>
> > But that doesn't make printf-debugging impossible, so if it's easier
> > for you, let's try that!
>
> i'll inform you about what I get

- when I move two fingers from bottom to top of the touchpad, i get for example:
 * delta: -1
 * p 2227 x 1414

delta is always negative in that case

- when I move two fingers from top to bottom of the touchpad, i get for example:
 * delta: 4
 * p 2205 x 1336

delta is always positive in that case

I've also found that the function always exits in that test, in case it helps:

      if (eabs (sum_delta_y) < WHEEL_DELTA)
        {
          result->kind = NO_EVENT;
          return Qnil;
        }

Unrelated : you should check the warnings, at least on Windows,
because i've seen a NULL pointer dereference, and several use of
uninitialized variables

Vincent