unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: Ted Phelps <phelps@pobox.com>, 5848@debbugs.gnu.org
Subject: bug#5848: 23.1.95; bands of background after font change if --with-x-toolkit=no
Date: Wed, 07 Apr 2010 11:18:25 +0200	[thread overview]
Message-ID: <4BBC4DE1.5020606@swipnet.se> (raw)
In-Reply-To: <wl4ojof77e.wl%mituharu@math.s.chiba-u.ac.jp>



YAMAMOTO Mitsuharu skrev 2010-04-07 02.16:
>>>>>> On Tue, 06 Apr 2010 20:54:24 +0200, Jan Djärv<jan.h.d@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.







  parent reply	other threads:[~2010-04-07  9:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-06 14:25 bug#5848: 23.1.95; bands of background after font change if --with-x-toolkit=no Ted Phelps
2010-04-06 16:20 ` Chong Yidong
2010-04-06 17:49 ` Jan Djärv
2010-04-07  1:43   ` Ted Phelps
2010-04-07  1:46   ` Ted Phelps
2010-04-06 17:57 ` Jan Djärv
2010-04-07  1:44   ` Ted Phelps
2010-04-06 18:54 ` Jan Djärv
2010-04-07  0:16   ` YAMAMOTO Mitsuharu
2010-04-07  6:35     ` Jan Djärv
2010-04-07  6:52       ` Ted Phelps
2010-04-07  8:23         ` Jan Djärv
2010-04-07  9:42           ` Jan Djärv
2010-04-07  9:54           ` Ted Phelps
2010-04-07 10:08             ` Jan Djärv
2010-04-07 11:56               ` Jan Djärv
2010-04-07  9:18     ` Jan Djärv [this message]
2010-04-07  9:48       ` YAMAMOTO Mitsuharu
2010-04-07 10:03         ` Jan Djärv
2010-04-07 10:25           ` YAMAMOTO Mitsuharu
     [not found] ` <handler.5848.D5848.12706414007122.ackdone@debbugs.gnu.org>
2010-04-07 12:06   ` Jan Djärv
2010-04-07 15:21     ` Chong Yidong
2010-04-07 16:35       ` Jan Djärv
     [not found] ` <handler.5848.D5848.12706414007122.notifdone@debbugs.gnu.org>
2010-04-08  0:26   ` bug#5848: closed by Jan Djärv <jan.h.d@swipnet.se> (Re: bug#5848: 23.1.95; bands of background after font change if --with-x-toolkit=no) Ted Phelps

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=4BBC4DE1.5020606@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=5848@debbugs.gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    --cc=phelps@pobox.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).