emacs-devel
[Top][All Lists]
Advanced

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

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


From: Jan Djärv
Subject: Re: [Fwd: Frame Height Different for Default Frame and Additional Frames]
Date: Wed, 10 Oct 2007 09:39:40 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20070728)



martin rudalics skrev:
 > It has not been fixed.  Further more, different toolkits/ports needs
 > different fixes, so the w32 port needs its own unique fix.

I see.  But isn't this frame size increase hardcoded in the following
section of frame.c?

I haven't seen this code before, it will not do the right thing for Gtk+ at least. I think this code assumes the Emacs native tool bar. I don't know if w32 uses that.



  /* 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))
    {
      ...

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

If I understand this code correctly, it always adds some lines to the
default frame when a toolbar is present.  Apparently it fails to do so
for the initial frame on w32.  The first comment is not really an
enlightment in this regard.

Could you clarify two things: (1) How is this code related to initial
frames and default frames; does (should) it affect only the latter or
both ?  (2) Doesn't the (toolbar_p && FRAME_TOOL_BAR_LINES (f))
condition hardcode a size increase whenever a toolbar is present ?

(1). It depends on frame parameters and tool kit used. FRAME_TOOL_BAR_LINES is always 0 for Gtk+ which uses an external (gtk+) tool bar. For the native Emacs tool bar, it is taken from the frame parameters.

(2) Not for the external tool bar. Then FRAME_TOOL_BAR_LINES (f) is 0. But for the native Emacs tool bar, it does.



Also, the second comment seems to indicate that the frame size should
remain constant regardless of whether a toolbar is present or not.  Is
this correct ?

I think the purpose is that if you specify -g 80x24, you should get 24 lines that you can edit, with or without the tool bar. The native tool bar confuses things by being specified in lines also (to help redisplay I guess). So if you have a tool bar that occupies two lines and you said -g 80x24, the frame will actually be 26 lines high. Or that is the intent anyway.

I think the bug is because frame parameters for the first frame is applied after the frame already has been created, but for frames created later, they are applied before the frame gets created.

        Jan D.




reply via email to

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