unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@iro.umontreal.ca,  emacs-devel@gnu.org
Subject: Re: Pixel scrolling support
Date: Fri, 26 Nov 2021 19:38:10 +0800	[thread overview]
Message-ID: <87bl27f8pp.fsf@yahoo.com> (raw)
In-Reply-To: <83sfvj2m51.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Nov 2021 13:26:34 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> That name tells me that the _mode_ is "precise", but that's not what you
> want to convey.  The scrolling is precise, not the mode.
>
> An alternative would be something like pixel-scroll-smoothly-mode.

Hmm, reasonable, "precision" makes sense now.

>> 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.

>> 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.

Afterwards, I set the window start to that position, and set the vscroll
to the object Y in the position list that is returned, which contains
the number of pixels that are still left after window start has been
adjusted.

I don't see how `vertical-motion' could help.

>> > 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?

>> >> +(defun pixel-scroll-precise (event &optional arg)
>> >> +  "Scroll the display according to EVENT.
>> 
>> > This sentence should include something to indicate the "precise"
>> > feature.  Otherwise it is too general, indistinguishable from any
>> > other scroll command.
>> 
>> Hmm, how about "Scroll the display by pixels according to EVENT"?
>
> Better.
>
>> >> +Take into account any pixel deltas in EVENT to scroll the display
>> >> +according to the user's turning the mouse wheel.  If EVENT does
>> >> +not have precise scrolling deltas, call `mwheel-scroll' instead.
>> 
>> > This describes what the code does, not what the user should expect in
>> > terms of the effect on the screen.
>> 
>>   "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.

> 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, so while
wheel rotation is reported in that direction, there is no way to scroll
the display horizontally in a pixel-wise fashion.

Thanks in advance.



  reply	other threads:[~2021-11-26 11:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87a6hrzrcv.fsf.ref@yahoo.com>
2021-11-26  0:35 ` Pixel scrolling support Po Lu
2021-11-26  2:26   ` Stefan Monnier
2021-11-26  3:06     ` Po Lu
2021-11-26  3:12       ` Po Lu
2021-11-26  6:41         ` Eli Zaretskii
2021-11-26  6:40       ` Eli Zaretskii
2021-11-26  6:45         ` Po Lu
2021-11-26  6:58           ` Eli Zaretskii
2021-11-26  7:01             ` Po Lu
2021-11-26  8:35               ` Eli Zaretskii
2021-11-26  9:29                 ` Po Lu
2021-11-26 11:26                   ` Eli Zaretskii
2021-11-26 11:38                     ` Po Lu [this message]
2021-11-26 12:00                       ` Eli Zaretskii
2021-11-26 12:09                         ` Po Lu
2021-11-26 12:42                           ` Eli Zaretskii
2021-11-26 12:46                             ` Po Lu
2021-11-26 12:49                               ` Po Lu
2021-11-26 13:00                                 ` Eli Zaretskii
2021-11-26 13:03                                   ` Po Lu
2021-11-26 12:07                       ` Stephen Berman
2021-11-26 13:35       ` Stefan Monnier
2021-11-26 13:41         ` Po Lu
2021-11-26 13:46           ` Eli Zaretskii
2021-11-26 13:50             ` Po Lu
2021-11-26  5:57   ` Aaron Madlon-Kay
2021-11-26  6:00     ` Po Lu
2021-11-26  6:11       ` Aaron Madlon-Kay
2021-11-26  6:22   ` Jim Porter
2021-11-26  6:30     ` Po Lu
2021-11-26  6:33   ` Eli Zaretskii
2022-05-18  2:53   ` Michael Heerdegen
2022-05-18  3:11     ` Po Lu
2022-05-18  3:27       ` pixel scroll vs. osm (was: Pixel scrolling support) Michael Heerdegen
2022-05-18  3:47         ` pixel scroll vs. osm Po Lu
2022-05-19  0:34           ` Michael Heerdegen
2022-05-21  0:18           ` Michael Heerdegen
2022-05-21  1:34             ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87bl27f8pp.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).