unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: feature/fix-the-long-lines-display-bug 0699f80f85 1/2: Fix calculation of the vertical scroll bar's thumb
Date: Tue, 19 Jul 2022 05:40:35 +0300	[thread overview]
Message-ID: <83ilntome4.fsf@gnu.org> (raw)
In-Reply-To: <87wnc9c3za.fsf@yahoo.com> (message from Po Lu on Tue, 19 Jul 2022 08:59:05 +0800)

> From: Po Lu <luangruo@yahoo.com>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Tue, 19 Jul 2022 08:59:05 +0800
> 
> Gregory Heytings <gregory@heytings.org> writes:
> 
> > branch: feature/fix-the-long-lines-display-bug
> > commit 0699f80f851b1f9e2f7b0a22ddd688abb7bebde1
> > Author: Eli Zaretskii <eliz@gnu.org>
> > Commit: Gregory Heytings <gregory@heytings.org>
> >
> >     Fix calculation of the vertical scroll bar's thumb
> >     
> >     * src/xdisp.c (set_vertical_scroll_bar): Compute window's end
> >     position "by hand" if w->window_end_pos cannot be relied upon.
> > ---
> >  src/xdisp.c | 18 +++++++++++++++++-
> >  1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/xdisp.c b/src/xdisp.c
> > index 375158a520..ae6553d876 100644
> > --- a/src/xdisp.c
> > +++ b/src/xdisp.c
> > @@ -18924,11 +18924,27 @@ set_vertical_scroll_bar (struct window *w)
> >  	  && NILP (echo_area_buffer[0])))
> >      {
> >        struct buffer *buf = XBUFFER (w->contents);
> > +      ptrdiff_t window_end_pos = w->window_end_pos;
> > +
> > +      /* If w->window_end_pos cannot be trusted, recompute it "the
> > +	 hard way".  */
> > +      if (!w->window_end_valid)
> > +	{
> > +	  struct it it;
> > +	  struct text_pos start_pos;
> > +
> > +	  SET_TEXT_POS_FROM_MARKER (start_pos, w->start);
> > +	  start_display (&it, w, start_pos);
> > +	  move_it_to (&it, -1, it.last_visible_x, window_box_height (w), -1,
> > +		      MOVE_TO_X | MOVE_TO_Y);
> > +	  window_end_pos = BUF_Z (buf) - IT_CHARPOS (it);
> > +	}
> > +
> >        whole = BUF_ZV (buf) - BUF_BEGV (buf);
> >        start = marker_position (w->start) - BUF_BEGV (buf);
> >        /* I don't think this is guaranteed to be right.  For the
> >  	 moment, we'll pretend it is.  */
> > -      end = BUF_Z (buf) - w->window_end_pos - BUF_BEGV (buf);
> > +      end = BUF_Z (buf) - window_end_pos - BUF_BEGV (buf);
> >  
> >        if (end < start)
> >  	end = start;
> 
> When making changes of this kind, you should test without toolkit scroll
> bars, and with at least both the Motif (with
> scroll-bar-adjust-thumb-position both on and off) and Xaw scroll bars to
> make sure they still work correctly.  Testing on NS also helps, since
> the scroll bar logic there is somewhat different.
> 
> The last time I tried to significantly change the scroll bar logic (to
> operate on more realistic positions within a window), those specific
> configurations bit me hard.

I don't have any access to such systems, sorry.  If you see specific
problems with that change, please tell.  Otherwise, we will have to
rely on people reporting bugs.



  reply	other threads:[~2022-07-19  2:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165817757368.23995.17503819582850726768@vcs2.savannah.gnu.org>
     [not found] ` <20220718205254.2F890C0F203@vcs2.savannah.gnu.org>
2022-07-19  0:59   ` feature/fix-the-long-lines-display-bug 0699f80f85 1/2: Fix calculation of the vertical scroll bar's thumb Po Lu
2022-07-19  2:40     ` Eli Zaretskii [this message]
2022-07-19  3:25       ` Po Lu
2022-07-19  5:11         ` Gregory Heytings
2022-07-19  5:38           ` Po Lu
2022-07-19 11:47           ` Eli Zaretskii
2022-07-19 12:53             ` Gregory Heytings
2022-07-19 13:17               ` Eli Zaretskii

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=83ilntome4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.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 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).