[Top][All Lists]

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

Re: [Fwd: Frame Height Different for Default Frame and Additional Frames

From: martin rudalics
Subject: Re: [Fwd: Frame Height Different for Default Frame and Additional Frames]
Date: Thu, 27 Dec 2007 20:10:50 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> Does this bug still happen for you, or has it been fixed?
>     > Create a one-line .emacs like
>     >
>     > (add-to-list 'default-frame-alist '(height . 37))
>     >
>     > that is, the frame height should be less than that of your screen.
>     >
>     > Start Emacs, do C-x 5 2, and tell us whether the heights of the two
>     > frames differ.
>     Yes they do.  It looks like default-frame-alist is ignored for the first 
> This does not fail for me.  When I start Emacs with just
>     (add-to-list 'default-frame-alist '(height . 15))
> in .emacs, it makes a 15-line frame.  I tested that in Emacs 22
> and in the trunk, and it makes a 15-line frame in both.
> (The frame starts out the default size and then shrinks, of course.)

The size of the initial frame seems correct because initial frames get
the same height regardless of whether they have a tool-bar or not (if
they didn't we'd probably have another bug).  Hence, I conclude that
additional frames created _after_ the initial frame are too high.
Commenting out the following stretch from frame.c fixes the bug for me.

  /* This used to be done _before_ calling x_figure_window_size, but
     since the height is reset here, this was really a no-op.  I
     assume that moving it here does what Gerd intended (although he
     no longer can remember what that was...  ++KFS, 2003-03-25.  */

  /* Add the tool-bar height to the initial frame height so that the
     user gets a text display area of the size he specified with -g or
     via .Xdefaults.  Later changes of the tool-bar height don't
     change the frame size.  This is done so that users can create
     tall Emacs frames without having to guess how tall the tool-bar
     will get.  */
  if (toolbar_p && FRAME_TOOL_BAR_LINES (f))
      int margin, relief, bar_height;

      relief = (tool_bar_button_relief >= 0
                ? tool_bar_button_relief

      if (INTEGERP (Vtool_bar_button_margin)
          && XINT (Vtool_bar_button_margin) > 0)
        margin = XFASTINT (Vtool_bar_button_margin);
      else if (CONSP (Vtool_bar_button_margin)
               && INTEGERP (XCDR (Vtool_bar_button_margin))
               && XINT (XCDR (Vtool_bar_button_margin)) > 0)
        margin = XFASTINT (XCDR (Vtool_bar_button_margin));
        margin = 0;

      bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
      FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / 

reply via email to

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