From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Can someone explain this code in xterm.c?
Date: 29 Apr 2003 00:16:04 +0200 [thread overview]
Message-ID: <5x1xzmjmjf.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <E19A0PT-00020w-00@fencepost.gnu.org>
Richard Stallman <rms@gnu.org> writes:
> In x_set_window_size_1, the vertical_scroll_bar_extra setting may be
> set to a non-integral fraction of the canonical column width of the
> frame:
>
> It appears to me that vertical_scroll_bar_extra holds the
> width in pixels of the scroll bar, in all cases. Its name is
> misleading.
But AFAICS it is not used for that purpose -- in the cases where it is
used (notably in CHAR_TO_PIXEL_WIDTH), it is supposed to be the width
of the scroll bar _area_, not the actual width of the scroll bar.
>
> You would think that FRAME_SCROLL_BAR_PIXEL_WIDTH has that value,
> but it is different. It records the specified pixel width of the
> scroll bar, or 0 if it has not been specified.
>
> Perhaps both names should be changed.
This is messy, so yes.
But I would rather go over each use (there are only a few) of
vertical_scroll_bar_extra and change them to use the proper value of
either FRAME_SCROLL_BAR_PIXEL_WIDTH or "scroll_bar_columns *
canonical_x_unit".
>
> Anywhere else (including the normal X widget case, GTK, W32, and MAC
> ports), the vertical_scroll_bar_extra is set to an multiple of the
> canonical column width.
>
> I think there are some other places where it uses
> FRAME_SCROLL_BAR_PIXEL_WIDTH for this.
Yes, that setting is used to specify a non-canonical scroll bar width
(which is then shown in a canonical width scroll bar area).
>
> This setting is used in the calculation of the total width of the
> frame window (in macro CHAR_TO_PIXEL_WIDTH), but in other parts of the
> code, the width of the scroll bar _area_ is always calculated as the
> number of scroll bar colums multiplied by the font width (canonical x
> unit).
>
> I think that in some cases the actual display of the scroll bar is
> determined by the number of columns. You can specify a non-integral
> width, but it leaves the excess blank.
Precisely, but in those cases, FRAME_SCROLL_BAR_PIXEL_WIDTH is used
explicitly, not vertical_scroll_bar_extra.
>
> I don't remember the reason it is done this way, but I do remember
> there was one.
Maybe vertical_scroll_bar_extra is a left-over from before the new
display engine, but I have no way to verify that.
I have tried to set a breakpoint on x_set_window_size_1 with emacs
running under X on GNU/Linux, but it is not activated...
So when is x_set_window_size_1 activated -- e.g. as the comment on
x_set_window_size_1 suggests, when doe emacs run under X without a
widget? And in those cases, does it still have scroll bars?
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
next prev parent reply other threads:[~2003-04-28 22:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-25 1:56 Can someone explain this code in xterm.c? Kim F. Storm
2003-04-28 4:38 ` Richard Stallman
2003-04-28 19:16 ` Alex Schroeder
2003-04-28 22:16 ` Kim F. Storm [this message]
2003-04-29 19:29 ` Richard Stallman
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=5x1xzmjmjf.fsf@kfs2.cua.dk \
--to=storm@cua.dk \
--cc=emacs-devel@gnu.org \
/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.