From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [Fwd: Frame Height Different for Default Frame and Additional Frames] Date: Thu, 27 Dec 2007 20:10:50 +0100 Message-ID: <4773F8BA.4090009@gmx.at> References: <002501c8044b$fcc95390$6100000a@intermedinc.internal> <4701F8AC.6070900@gmx.at> <470A9D22.2040709@gmx.at> <470BF1BF.3000609@gmx.at> <470C695D.5010906@swipnet.se> <470DE439.1030603@gmx.at> <470E655E.10905@swipnet.se> 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: ger.gmane.org 1198782663 13241 80.91.229.12 (27 Dec 2007 19:11:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2007 19:11:03 +0000 (UTC) Cc: =?ISO-8859-15?Q?Jan_Dj=E4rv?= , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 27 20:11: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 1J7y8L-0006Y6-Jv for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 20:11:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7y80-0002nF-Kg for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 14:10:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J7y7w-0002mi-VA for emacs-devel@gnu.org; Thu, 27 Dec 2007 14:10:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J7y7v-0002lm-Sd for emacs-devel@gnu.org; Thu, 27 Dec 2007 14:10:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7y7v-0002lZ-Om for emacs-devel@gnu.org; Thu, 27 Dec 2007 14:10:43 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1J7y7u-0002km-Ux for emacs-devel@gnu.org; Thu, 27 Dec 2007 14:10:43 -0500 Original-Received: (qmail invoked by alias); 27 Dec 2007 19:10:41 -0000 Original-Received: from M3145P005.adsl.highway.telekom.at (EHLO [88.117.41.5]) [88.117.41.5] by mail.gmx.net (mp002) with SMTP; 27 Dec 2007 20:10:41 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18RJdBABPkRRecoOntvG0izXc2CAZKLQv20Pje+Gv awNFJ/euhkrcl1 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:85525 Archived-At: > 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 frame. > > 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 : 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; FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f); }