emacs-devel
[Top][All Lists]
Advanced

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

Inactive code in x-create-frame on X and W32.


From: Kim F. Storm
Subject: Inactive code in x-create-frame on X and W32.
Date: 25 Mar 2003 02:09:00 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

In xfns.c (and later copied to w32fns.c), Fx_create_frame contains the
following code:

  /* 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 (FRAME_TOOL_BAR_LINES (f))
    {
      int margin, relief, bar_height;

      relief = (tool_bar_button_relief >= 0
                ? tool_bar_button_relief
                : DEFAULT_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));
      else
        margin = 0;

      bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
      f->height += (bar_height + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
    }

  /* Compute the size of the X window.  */
  window_prompting = x_figure_window_size (f, parms);


But x_figure_window_size does the following unconditionally:

  f->height = DEFAULT_ROWS;

So the result of the "if (FRAME_TOOL_BAR_LINES...)" block is effectively
ignored.

I would guess that the call to x_figure_window_size should be moved
before adjusting f->height for the tool-bars, but I'm not quite sure
what the intention is, since the ChangeLog explicitly says to
do this _before_ calling x_figure_window_size:

2001-03-01  Gerd Moellmann  <address@hidden>

        * xfns.c (Fx_create_frame): Adjust the frame's height for presence
        of the tool bar before calling x_figure_window_size.

So what's up, doc?  






reply via email to

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