From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#37609: Tool-bar-mode grows the frame's height Date: Sat, 5 Oct 2019 20:11:06 +0200 Message-ID: References: <87bluxihw0.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="184628"; mail-complaints-to="usenet@blaine.gmane.org" To: Juri Linkov , 37609@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 05 20:12:41 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iGoXp-000luZ-5F for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Oct 2019 20:12:41 +0200 Original-Received: from localhost ([::1]:58308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGoXn-0004ds-Lg for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Oct 2019 14:12:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iGoXD-0004dU-T2 for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 14:12:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iGoXC-0001pE-NL for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 14:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36390) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iGoXC-0001p6-K4 for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 14:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iGoXC-0004th-C4 for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2019 14:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2019 18:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37609 X-GNU-PR-Package: emacs Original-Received: via spool by 37609-submit@debbugs.gnu.org id=B37609.157029908018773 (code B ref 37609); Sat, 05 Oct 2019 18:12:02 +0000 Original-Received: (at 37609) by debbugs.gnu.org; 5 Oct 2019 18:11:20 +0000 Original-Received: from localhost ([127.0.0.1]:45211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGoWV-0004sj-JV for submit@debbugs.gnu.org; Sat, 05 Oct 2019 14:11:19 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:35399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iGoWT-0004sW-V4 for 37609@debbugs.gnu.org; Sat, 05 Oct 2019 14:11:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1570299066; bh=c71LIYfxcYktGVy8+4gG+FOCufOTGAAeGqSgurAcFrE=; h=X-UI-Sender-Class:Subject:From:To:References:Date:In-Reply-To; b=RCEV0/Zu2R8yoqyF+r2mosgDl30Q6ZaIrGkk67ebCUdApe7oH9nnvPxW/0I5J6Bz9 Jl8yUA5qC9iCghrVdAMcMeNBgrYHQzQbCSwO9MLYVAcMGvIniW/3/+Anv3vv7vU482 8CSlmRWx1dM5rDzlNsnfRnPtAJF8XdLv1XmQXrXc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.248]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mw9UK-1i06W61GZI-00s77T; Sat, 05 Oct 2019 20:11:06 +0200 In-Reply-To: Content-Language: de-AT X-Provags-ID: V03:K1:B1JX04CSIyOWlo8ai0FmYmEeT1wkP/mtuZr4+jx4V2uUVEUVUfS qz4kiF8Jas6PrpFKQr0ppjA+WxY3U7AKaHwxJXC2hAV6o4Vo/Tbm39deSssQ5/FhraqH76B jhxvCYya1K4e3p0yVbG91AkCrzDzJ9cYU8DLQpLQFidCZselJORypcwP/elGuStfTw1ghyL ebJlZBtccRNjxxTAjugjg== X-UI-Out-Filterresults: notjunk:1;V03:K0:5E1ML8TY+cg=:H9CPMmKlMRRk9iGO4boW21 yhC2NfqKgXBPbwJ50hhXw3xa0NIh6vgcj7CQh0f/Sl6e8EBRkLKMKsbkxQnZVqhmQ9MmFL7XN /HH9/jqMNDegDZpZtpQwPGU/dfLxz1LBlAvvnm+WPiUT0V4F26nVW/Womy0q2PbUeC9s64A6j zLqxxKImhYE19SoHnmrNiqS0M7AOn40cDlCqGMc3ZX8wno17OWJqz2r/4SLbJ9uMWAPVOeCOy YKZuNpjRxiRNosTHzRIHLO1f+5ymCdyNh4mL070hzlDNtySrXJpntauYiLIfD6F8z90yvLHl4 H3btfoB8R6IX+OrXUAKcb+SrUCWgnm0gKInPFa12XBKIMsVi8rdoYBS1q5dxFXSSb52gOXgR4 2HY81gxsdinXhoEz2qZEgJCcKQIHiA7aeCdT1QmeOA6tZwSonktaVosovpgJJgn3B+gSlTjeS OLdJmWOA6tuPM1DwwST+8/3ieisTNjGZghd3te/TFblJGO7auXbsBL+anVdrXQyUPksBUjp49 iy6Z6MklT9wxCTUein8bWUjb525S3kDcR7dJlo1Kv+fxAzu6tiGV3EROeqKKWWl3tynv+JMpf 3u9xIyfatyHOld1yq1gvYJaEteLzkVOdzCzdIJEOg1pHKDNUAV9Aa4lRZs2PxaueKr1DjIb7M i5PH1Lv9yTWcYSrJlNbDlGUyUABPnPfxfq/lVxJXNfct4F963LomoKrWI0cnaWty6TuQbugMc 1JzYbfbiTS7LL1qPMJ1VHSVTu/RlZihSlvcVfy6y8qJvikQt5UNkWDcJT9v644uO2pRURJj6 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168390 Archived-At: > > OTOH, in a new session again with emacs -Q -f tool-bar-mode > [...] > > (tool-bar-mode 1) > > This changes the outer frame size (also on Windows) which it shouldn't do. > I'll look into it. As a matter of fact, the behavior you see _is_ the intended one. On platforms where Emacs draws the tool bar into the frame (Lucid, Motif, Windows) it has to (1) first trigger redisplay into drawing the tool bar at least once so to get its real height and then (2) resize the frame accordingly so it gets the requested initial number of lines. This means that with > emacs -Q -f tool-bar-mode > > that disables tool-bar-mode before it's displayed for the first time, no tool bar gets drawn, > and evaluating > > (let ((initial (assq 'outer-size (frame-geometry)))) > (tool-bar-mode 1) this triggers the resizing of the frame to give it the desired number of initial lines when a tool bar is present, and > (tool-bar-mode 0) > (list (assq 'outer-size (frame-geometry)) initial)) does _not_ size the frame back because that's the way toggling the tool bar behaves ever since on the platforms cited above. The same holds for the behavior you described as > => ((outer-size 680 . 693) (outer-size 680 . 676)) > > indicates growing of the frame's height. > > Evaluating the same again produces the correct result: > > => ((outer-size 680 . 693) (outer-size 680 . 693)) > > OTOH, in a new session again with emacs -Q -f tool-bar-mode > > (progn > (tool-bar-mode 1) > (assq 'outer-size (frame-geometry))) > > => (outer-size 680 . 693) > > (progn > (tool-bar-mode 0) > (assq 'outer-size (frame-geometry))) > > => (outer-size 680 . 693) > > It's strange that the results are the same because visually > the frame's height grows. The frame grows in both cases to 693 pixels when the tool bar is drawn for the first time and never resizes afterwards (even when the tool bar wraps). We probably could suppress such untimely growing by tricking the code into believing that the tool bar has already been drawn at least once even if it was not drawn at all. But I'm not sure whether such a change could break runs where showing the tool bar might be delayed for some reason. Getting the 'frame-inhibit-implied-resize' stuff perform sufficiently well was quite tricky. So is the behavior we see here annoying enough to warrant such a change? martin