[Top][All Lists]

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

Re: Pixel scrolling support

From: Eli Zaretskii
Subject: Re: Pixel scrolling support
Date: Fri, 26 Nov 2021 14:00:06 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: monnier@iro.umontreal.ca,  emacs-devel@gnu.org
> Date: Fri, 26 Nov 2021 19:38:10 +0800
> >> How about this: "When enabled, you can scroll the display up or down by
> >> individual pixels in a way that corresponds with the movement of your
> >> mouse wheel, if supported by the mouse wheel."?
> > "By individual pixels" is not really accurate, is it?  Maybe "at pixel
> > resolution".  And now the question becomes "how is this different from
> > pixel-scroll-mode"?  Which is a good question regardless of NEWS, btw.
> pixel-scroll-mode still scrolls by lines, it just tries to animate each
> line movement.  It's very unpleasant to use that with a precision scroll
> wheel.

Well, that sounds like a good description of the difference (minus the
"unpleasant" part) to have in the NEWS entry.

> >> Basically, we use `posn-at-x-y' to find the window start and the vscroll
> >> that's wanted, which doesn't work when y is outside the window.
> > Did you try to use vertical-motion to help you?  Or maybe I don't
> > understand the problem, since the vertical dimensions of a window are
> > known in pixels, so what exactly is the problem to determine the
> > window start when it is outside of the window?  scroll-down-command
> > does that without any problems.
> I use `posn-at-x-y' to determine the position closest to the first line
> to be displayed on screen after the window is vscrolled by DELTA.

How do you know which line is "the first line to be displayed on
screen after the window is vscrolled by DELTA"?  That's the bit I'm
missing, I think.

> >> > I think you should detect the EOB condition early on and simply not
> >> > scroll at all in that case.
> >> 
> >> I couldn't find a way to know if scrolling will result in EOB before it
> >> actually happens.
> > Did you try using pos-visible-in-window-p with POS argument passed as
> > t?
> But that doesn't take into account the delta by which the window is
> being scrolled, right?

What is "the delta by which the window is being scrolled"?  Is that
the window's vscroll or is that something else?

> >>   "Scroll the display vertically by pixels according to EVENT.
> >> Move the display up or down by the pixel deltas in EVENT to
> >> scroll the display according to the user's turning the mouse
> >> wheel."
> >> 
> >> How's this instead?
> > Where did the "call `mwheel-scroll'" part disappear?  If it was
> > important to say that, why there's no reflection of that in the new
> > text?
> As ARG is gone, I don't think it's important to mention that
> `mwheel-scroll' is called anymore.

See my question about the difference between mwheel and this mode: it
might be important after all.

> > I'm asking why don't we support pixel-resolution horizontal scrolling
> > in this mode, although the underlying infrastructure does report
> > pixel-resolution mouse-wheel rotation in the horizontal direction?
> AFAIU, redisplay doesn't support pixel-resolution hscroll

Of course, it does.  It might not be exposed to Lisp (I didn't look
closely enough), but it is certainly supported on the C level.

reply via email to

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