GNU bug report logs -
#5848
23.1.95; bands of background after font change if --with-x-toolkit=no
Previous Next
Reported by: Ted Phelps <phelps <at> pobox.com>
Date: Tue, 6 Apr 2010 14:28:02 UTC
Severity: normal
Done: Jan Djärv <jan.h.d <at> swipnet.se>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 5848 <at> debbugs.gnu.org (full text, mbox):
YAMAMOTO Mitsuharu skrev 2010-04-07 02.16:
>>>>>> On Tue, 06 Apr 2010 20:54:24 +0200, Jan Djärv<jan.h.d <at> swipnet.se> said:
>
>> /* Return the pixel width/height of frame F if it has
>> COLS columns/LINES rows. */
>
>> #define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
>> (FRAME_COL_TO_PIXEL_X (f, cols) \
>> + (f)->scroll_bar_actual_width \
>> + FRAME_TOTAL_FRINGE_WIDTH (f) \
>> + FRAME_INTERNAL_BORDER_WIDTH (f))
>
>> #define w(f, lines) \
>> (FRAME_LINE_TO_PIXEL_Y (f, lines) \
>> + FRAME_INTERNAL_BORDER_WIDTH (f))
>
>
>> and
>
>> #define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width)
>
>> But the internal border is on two sides, so it should be
>> 2*FRAME_INTERNAL_BORDER_WIDTH (f).
>
> FRAME_COL_TO_PIXEL_X and FRAME_LINE_TO_PIXEL_Y include the left and
> top side internal border width, respectively. So, the internal border
> is already counted twice in FRAME_TEXT_COLS_TO_PIXEL_WIDTH and
> FRAME_TEXT_LINES_TO_PIXEL_HEIGHT above.
Upon further investigation, this is true for cols, but not always for lines.
We have
#define FRAME_LINE_TO_PIXEL_Y(f, row) \
((row < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \
+ (row) * FRAME_LINE_HEIGHT (f))
So if row is less than FRAME_TOP_MARGIN (which is menu bar lines + tool bar
lines), internal border width is not added. That makes sense for
FRAME_LINE_TO_PIXEL_Y as the internal border is below the tool bar. But it is
not correct for
FRAME_TEXT_LINES_TO_PIXEL_HEIGHT, which is supposed to return the total frame
size. When setting wm size hints, this call
base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
will return just one internal border. Thus, a pixel is missing.
Thanks for pointing me in the right direction.
Jan D.
This bug report was last modified 15 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.