From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46827: Broken initial size of GTK3 frame Date: Thu, 13 May 2021 19:24:06 +0300 Organization: LINKOV.NET Message-ID: <874kf6sq8p.fsf@mail.linkov.net> References: <6caa020a-084c-e3f2-7a34-262f7127b21b@gmx.at> <87bl9uqjuq.fsf@mail.linkov.net> <874kfk50f4.fsf@mail.linkov.net> <7e503d11-5cd0-9ed7-e75a-5977eb5ecf3a@gmx.at> <3096e1f1-0090-5892-c752-bd82d974214e@gmx.at> <871ranagzo.fsf@mail.linkov.net> <9736f3c8-157c-423d-55ad-21118c48d939@gmx.at> <93f1d912-a26f-ccf9-926b-731ad02d7734@gmx.at> <87sg32chgv.fsf@mail.linkov.net> <63e9cb33-afc0-8e9c-4e35-78f5e504eb47@gmx.at> <87h7jhgiqs.fsf@mail.linkov.net> <87o8dmppdn.fsf@mail.linkov.net> <6565dd1a-5933-00e3-4427-c713aa36d6d5@gmx.at> <87r1iexuoc.fsf@mail.linkov.net> <8735utyyla.fsf@mail.linkov.net> <62983626-60c1-5d8b-7ad6-67c65b408195@gmx.at> <87y2cjvp2s.fsf@mail.linkov.net> <7f7d8029-1b32-fae7-837a-fe0c65281510@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15684"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 46827@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 13 18:52:53 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhEZx-0003xq-0g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 18:52:53 +0200 Original-Received: from localhost ([::1]:38770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhEZv-0000uC-KD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 May 2021 12:52:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhEFm-00071u-Ey for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 12:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhEFm-0004zF-5d for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 12:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhEFm-0007xw-1W for bug-gnu-emacs@gnu.org; Thu, 13 May 2021 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 May 2021 16:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46827 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 46827-submit@debbugs.gnu.org id=B46827.162092351230604 (code B ref 46827); Thu, 13 May 2021 16:32:01 +0000 Original-Received: (at 46827) by debbugs.gnu.org; 13 May 2021 16:31:52 +0000 Original-Received: from localhost ([127.0.0.1]:44185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhEFc-0007xY-DA for submit@debbugs.gnu.org; Thu, 13 May 2021 12:31:52 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:47465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhEFZ-0007xF-C2 for 46827@debbugs.gnu.org; Thu, 13 May 2021 12:31:50 -0400 Original-Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id DB5B1240003; Thu, 13 May 2021 16:31:41 +0000 (UTC) In-Reply-To: <7f7d8029-1b32-fae7-837a-fe0c65281510@gmx.at> (martin rudalics's message of "Thu, 13 May 2021 09:54:16 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206454 Archived-At: --=-=-= Content-Type: text/plain >> Isn't this a bug that the tool bar and menu bar incorrectly calculate lines? > > The lines are calculated correctly by rounding up when we divide the > object's pixel height by the default character height of the frame. But > that calculated value is useless on a GUI. Accoring to window-total-height, the currently used rounding in x_change_tab_bar_height corresponds to 'ceiling': return make_fixnum (EQ (round, Qceiling) ? ((w->pixel_height + unit - 1) /unit) On a TTY where the frame line height is 1, this gives the correct result. But not on a GUI where the frame line height is measured in pixels. When the argument 'round' of window-total-height is 'floor', it uses the formula without subtracting 1 that works on a GUI too: : (w->pixel_height / unit)); This patch fixes this in x_change_tab_bar_height. Do you think the same fix should be applied to x_change_tool_bar_height as well? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=x_change_tab_bar_height.patch diff --git a/src/xfns.c b/src/xfns.c index e46616e6d6..82d22cc5f8 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1640,7 +1640,7 @@ x_change_tab_bar_height (struct frame *f, int height) { int unit = FRAME_LINE_HEIGHT (f); int old_height = FRAME_TAB_BAR_HEIGHT (f); - int lines = (height + unit - 1) / unit; + int lines = height / unit; Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); /* Make sure we redisplay all windows in this frame. */ --=-=-=--