From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: [Fwd: Frame Height Different for Default Frame and Additional Frames] Date: Wed, 10 Oct 2007 09:39:40 +0200 Message-ID: <470C81BC.70909@swipnet.se> References: <002501c8044b$fcc95390$6100000a@intermedinc.internal> <4701F8AC.6070900@gmx.at> <470A9D22.2040709@gmx.at> <470BF1BF.3000609@gmx.at> <470C695D.5010906@swipnet.se> <470C766C.1010503@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1192002077 6543 80.91.229.12 (10 Oct 2007 07:41:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Oct 2007 07:41:17 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 10 09:41:16 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IfWBi-0000jP-Bv for ged-emacs-devel@m.gmane.org; Wed, 10 Oct 2007 09:41:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfWBc-0001Lz-JA for ged-emacs-devel@m.gmane.org; Wed, 10 Oct 2007 03:40:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfWBE-0001BO-K2 for emacs-devel@gnu.org; Wed, 10 Oct 2007 03:40:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfWBC-0001AN-Rx for emacs-devel@gnu.org; Wed, 10 Oct 2007 03:40:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfWBC-0001AH-Pn for emacs-devel@gnu.org; Wed, 10 Oct 2007 03:40:30 -0400 Original-Received: from av7-1-sn3.vrr.skanova.net ([81.228.9.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IfWB4-0008F1-M1; Wed, 10 Oct 2007 03:40:23 -0400 Original-Received: by av7-1-sn3.vrr.skanova.net (Postfix, from userid 502) id 906D138F4A; Wed, 10 Oct 2007 09:39:15 +0200 (CEST) Original-Received: from smtp3-2-sn3.vrr.skanova.net (smtp3-2-sn3.vrr.skanova.net [81.228.9.102]) by av7-1-sn3.vrr.skanova.net (Postfix) with ESMTP id 769B738412; Wed, 10 Oct 2007 09:39:15 +0200 (CEST) Original-Received: from husetbladh.homeip.net (90-231-102-24-no59.tbcn.telia.com [90.231.102.24]) by smtp3-2-sn3.vrr.skanova.net (Postfix) with ESMTP id C5BD437E4D; Wed, 10 Oct 2007 09:40:21 +0200 (CEST) User-Agent: Thunderbird 2.0.0.6 (X11/20070728) In-Reply-To: <470C766C.1010503@gmx.at> X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:80496 Archived-At: 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.