emacs-devel
[Top][All Lists]
Advanced

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

Re: Can someone explain this code in xterm.c?


From: Kim F. Storm
Subject: Re: Can someone explain this code in xterm.c?
Date: 29 Apr 2003 00:16:04 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

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