all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: JD Smith <jdtsmith@gmail.com>
To: Eval EXEC <execvy@gmail.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: [Emacs Master d277123f4bf] pixel-scroll-precision-scroll-up-page feels pause, but pixel-scroll-precision-scroll-down-page is smooth
Date: Tue, 3 Sep 2024 14:14:35 -0400	[thread overview]
Message-ID: <73E3A3FA-A1AB-40EB-87B9-80BB8902682A@gmail.com> (raw)
In-Reply-To: <34bff610-732e-4c52-9574-35a4bab8223d@gmail.com>


> On Sep 3, 2024, at 5:56 AM, Eval EXEC <execvy@gmail.com> wrote:
> 
> Then I open a rust project.
> 
> use touchpad to scroll up and down. When I use touchpad to `triple-wheel-up`, I feel very lag and pause.
> 
> When I `triple-wheel-down`, it's very smooth.
> 
> 
> Why `pixel-scroll-precision-scroll-up-page` is very lag and pause, but `pixel-scroll-precision-scroll-down-page` is very smooth?

This asymmetry is inherent to vscroll, which, although very fast, is only available "below" the displayed screen contents.  To quote the FAQ of my ultra-scroll-mac[1] package:

    • Scrolling asymmetry:
        • vscroll is purely one-sided: you can only access a vscroll area beneath the current window view; there is no negative vscroll.
        • Unlike window-start, window-end does not get updated promptly between redisplays and cannot always be trusted.
        • For these two reasons, smooth scrolling up and scrolling down are not symmetric with each other (and will likely never be). You need different approaches for each.
        • If the two approaches for scrolling up and down perform quite differently, the user will feel this difference.

The algorithms employed in ultra-scroll-mac are (in my testing) measurably faster than the ones in pixel-scroll-precision (from which it was inspired), although up is still slower than down.  They also enable smooth scrolling past images which are taller than the window.  See the functions `ultra-scroll-mac-up/down'.  

Unfortunately this package only works on the Carbon emacs-mac port, which exposes rich scroll events with pixel-level delta data.  But the core scroll algorithms could potentially be adapted to pixel-scroll-precision-mode, and I'd be happy to contribute them if anyone takes this up.  I have also wondered whether other systems like Linux/GTK have standard APIs for delivering high-speed touchpad events, which would allow pixel-scroll-precision to get out of the business of simulating these.

[1] https://github.com/jdtsmith/ultra-scroll-mac




  reply	other threads:[~2024-09-03 18:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03  9:56 [Emacs Master d277123f4bf] pixel-scroll-precision-scroll-up-page feels pause, but pixel-scroll-precision-scroll-down-page is smooth Eval EXEC
2024-09-03 18:14 ` JD Smith [this message]
2024-09-04  1:13   ` Po Lu
2024-09-04  1:56     ` JD Smith
2024-09-04  2:32       ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73E3A3FA-A1AB-40EB-87B9-80BB8902682A@gmail.com \
    --to=jdtsmith@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=execvy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.