From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#46827: Broken initial size of GTK3 frame Date: Fri, 14 May 2021 09:08:20 +0200 Message-ID: <74ceb571-7fbb-f018-8c29-41cc1d3785d0@gmx.at> 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> <874kf6sq8p.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39984"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46827@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 09:09:12 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 1lhRwd-000AHa-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 09:09:11 +0200 Original-Received: from localhost ([::1]:41422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhRwc-0006Ra-Jq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 03:09:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhRwU-0006PG-KY for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhRwU-0000Jx-DS for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhRwU-0006pN-7v for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 03:09: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: Fri, 14 May 2021 07:09:02 +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.162097611126202 (code B ref 46827); Fri, 14 May 2021 07:09:02 +0000 Original-Received: (at 46827) by debbugs.gnu.org; 14 May 2021 07:08:31 +0000 Original-Received: from localhost ([127.0.0.1]:44812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhRvz-0006oW-HC for submit@debbugs.gnu.org; Fri, 14 May 2021 03:08:31 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:53541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhRvw-0006oG-11 for 46827@debbugs.gnu.org; Fri, 14 May 2021 03:08:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620976101; bh=imgB+cL5bG3cI9yxvT3BaBRK8NAl9WxNp6eh3Fo6Jwo=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=D+V1HeO6eZ1njmuQgGNirlKI1ObqcGA19MWAfymiwsMsAJCOV9N17U//N32gXuTaS mgpP2YzhcdMioYJQD2dd+EXHcxi8wh3uYIu3eIwiGmjQsS2ylUynicZIUJMInaiYg4 0s2252vygH7B3umza6JOajdwmaU1OOcwIcrfxZhk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.218]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N3KTo-1lYH031zGM-010Hcg; Fri, 14 May 2021 09:08:21 +0200 In-Reply-To: <874kf6sq8p.fsf@mail.linkov.net> Content-Language: en-US X-Provags-ID: V03:K1:cwGQVQFhAqjdAiF5OSL7th5SJ+K7rRYj0BaPbwrha/DsLrLDvjH 361QHQULk6+T+Z8vbHRCi8kwdUrDiPhYglzNERCPvi75KbkPymSdLcBnVAuzV5EuqEcisNz Z5zvW4v+9/v8IyBp7r+N3jFSv6MIWOwcsOHZd+Ts1zsJDzL/qf94dOnugHP23tkS7cvb8T8 PbGRIe7E/C1Qbz+Wk4ANQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:N9y4Uq3Lumk=:YKuGRMAhRraukX5TqagFT0 JiP/3p3BuN9i23FiYjsdeWGFxg7Z3tODO6sfSSbuPQlM8Vb5+iFsX4wybePs56eFKzJ3j9Cwm IUH9yR5k8yFfazjhEyqwJFzKJacFwrQySGcEyN0f33LVAIt+9ybsD81xVUDgpGeTRIL0e6Rfd 9stk+Dves5/dp8QAnsVFGxNrFM+VJzalCD2CGzo07NoWBZRahDhpuQysvsRJn6y9hCLQO+EBs PXGyZUFEmejwyDQipJET8uCq4ymaZfVg23hXxfWk+KEOV0Pq91BsSErhPuW3XRSMleg7+RtSN MjoIcm1h9YMtBKhmzlg87nPSjnPbHGbgEzz6fnAdc0Ygn2QM2c58OYWSBI2dzBaV3/+FTOtkX W4NIPDcy5dlHqOY8dyNsDDkhKjcV+27mYjzLvJ3AY4qH02cOBEpLnHoPaUbQnkMmi0GbqXESJ Dqg+Js1VPc4bizVkkE8BANlFq5syaxbKtGVvDpIU1KZVFAYrt7NL81tZK/+XpadNn0FRzvu7X WrDiJpq8yMJ3QdwapDaBwDn2xd0nuqec0jtqHwI0Dco51Vde5rzQj6NGzM9Xmv875ltaE0Frg ffnqfW52IeS6ZmBiRbcZfj42El6Vyp/GEMMVR/Da/TeFIr7Jy1UCYHtnrrgBfFSUa68kynVPY g6gz/pnC1wK/+WdQsiq2OXD5VN+IP8XVrlxL0U6sTm+gSNEFmh66zensY0DdkRv5o+r57bHAl Y+nIKUv+GFhAWLtOB0zQagt3nenWAZ8y2kj6DauGqRaR+cbXH8Qcl0zGiRW3kueeDCquvlFP 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:206485 Archived-At: >> 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? What does your patch fix? With a sufficiently small default font this will still return a value > 1. In either case, the height of the frame's inner rectangle plus those of internal tab, tool and menu bar should equal the height of the native rectangle in lines. Did you check that? In my experience, there's no way to make column/line based variables and functions always DTRT on a GUI. Code should avoid them. martin