From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Reuben Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#72986: Disabling menu-bar-mode changes size of new frames Date: Mon, 9 Sep 2024 18:52:29 +0100 Message-ID: References: <44e0648e-b374-4816-8f3b-6948af471ab1@gmx.at> <4c2fe23a-be76-4cdc-8f97-16197e1834b0@gmx.at> <300cb820-d6b7-44c6-8609-fa7804babf99@gmx.at> <56840844-930e-45b0-ae48-97b5875c51b9@gmx.at> Reply-To: Reuben Thomas Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000053b4950621b36cc8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6506"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Eli Zaretskii , 72986@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 09 19:54:23 2024 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 1sniaj-0001Vc-Us for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Sep 2024 19:54:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sniaQ-000664-In; Mon, 09 Sep 2024 13:54:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sniaN-0005s1-Fk for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2024 13:53:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sniaN-00006P-5D for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2024 13:53:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=/SJgrZlwIgIWIo8Wv+OoEwJU0vqmepYUy+CR8E+Unz0=; b=p8yiex0kgFBXltPKpxSvbztGC7JtWYNvs+jRgFXgec7b5mE8VMVUeqKZwScXIh/l9JVsiKglvK6BMXsL+OvtwmTmGOrXFUzUadDOH4He8S1sKLDuNnx6PQL3ZpcCpee00XgDYyCmLjjhabDLz0voN80Cy2rggoZBfCZT/+AwdQ+CmCK0YUGK5ylmQJVaRo9L/tDe5F1naINcgOdCZyZJSZpvs74Juy/Xus4wPCF4I02Y5vC24dU11jJoTwmT5L9fn2zXtc91tB2FbULTy+jm53qqeVEbMl/uCR0+m1F4zzYrsddGiCeEx2HRQGszxHnqVGZ3ukFDimT2+zyBjNZupg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sniaQ-0003FZ-VB for bug-gnu-emacs@gnu.org; Mon, 09 Sep 2024 13:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Reuben Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Sep 2024 17:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72986 X-GNU-PR-Package: emacs Original-Received: via spool by 72986-submit@debbugs.gnu.org id=B72986.172590443412465 (code B ref 72986); Mon, 09 Sep 2024 17:54:02 +0000 Original-Received: (at 72986) by debbugs.gnu.org; 9 Sep 2024 17:53:54 +0000 Original-Received: from localhost ([127.0.0.1]:34025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sniaH-0003Ex-Nl for submit@debbugs.gnu.org; Mon, 09 Sep 2024 13:53:54 -0400 Original-Received: from mail-yw1-f176.google.com ([209.85.128.176]:42193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sniaE-0003Eg-7U for 72986@debbugs.gnu.org; Mon, 09 Sep 2024 13:53:51 -0400 Original-Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-6bada443ffeso34575227b3.0 for <72986@debbugs.gnu.org>; Mon, 09 Sep 2024 10:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sc3d.org; s=google; t=1725904361; x=1726509161; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/SJgrZlwIgIWIo8Wv+OoEwJU0vqmepYUy+CR8E+Unz0=; b=Yz6XLU0qln+XmUjT3RYg38jUM4IqeO7RWDwcfsAZDQ2vmFT4asQaJ5kRQyTB15vONR uhThsTEkEE9oAzmcJGrkO5FW43Dg/KuuEE67XOOSSnPm8EYUISW76Lgh1CwTmBWSyH4i PhnVeRDaS6SbGdo5wuLtRiAQnkE7WXjJoOJfY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725904361; x=1726509161; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/SJgrZlwIgIWIo8Wv+OoEwJU0vqmepYUy+CR8E+Unz0=; b=ZM/ie+qj8NsU+nf+eO5DUssobm+86e4zoaOsVC5WpPSDJGJSEY5BqRzFqfEwajitSH fVlQSWC1QouC12aQNipKZuIHd70o5W3pWSPPUfHoq6gT34XeklSzdssPFtyyb1Y+l3D5 Fa5akO3lLMD8M9SkIALotRCLSyNrdX0DfB5rDyKIW3UiIpZEabKOnxJ7Yy7d6p34sDTY 5cgJ20XcQeLEcpohtk2w6MAqkRAOyGKA2vWIA7AQROBuH8KB2G3gh9ovxJ4hFxFR4N/l NAlfj06oxXF4zAc1r/lrurZY1XX3NNlFqO71mDVpPA2Q48dYgRLGunebbIzwgssmtm/G GuQg== X-Forwarded-Encrypted: i=1; AJvYcCUAgt8FUr/ZlrFkLzdTWxLuR6Bgp54JZmqMXwQqQ7NySQQEMXzn4aps4SY5fk8u71jzWaq2YQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz7AhDbsqF5fpEZ710SM6tBUZCrfgpWe/dYSFNTnLgN2l2t/Tnw 2KtxI8J4ofWQIaWGMSaoBxbuaIyTbsI2uVaPQvcvjJa21OiFFFW9PB2N6KLZ0JGSdAe5v5vcG9z mXFBB0+TwwF7Afnf1DwbZXiiHcFrYKj9RYTZK6g== X-Google-Smtp-Source: AGHT+IFOCfMLUeIYLCtCz1xF4pFUqnA6FvKC6y3qMU0F2pHlesxjYx48uV5OWxipxmiK5pCzENQT4EtCaZXuSLqm4rY= X-Received: by 2002:a05:690c:7092:b0:6db:46e6:cb75 with SMTP id 00721157ae682-6db9538e345mr5141917b3.11.1725904360542; Mon, 09 Sep 2024 10:52:40 -0700 (PDT) In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291522 Archived-At: --00000000000053b4950621b36cc8 Content-Type: text/plain; charset="UTF-8" I've removed the patch to frame.c, and I'm running with: emacs -Q --eval "(setq default-frame-alist '((menu-bar-lines . 0)))" On Mon, 9 Sept 2024 at 17:52, martin rudalics wrote: > > The result is not yet what I hoped for. We reject two ConfigureNotify > events but the ensuing xg_frame_set_char_size calls do not get us a > ConfigureNotify we'd accept. IIUC the final height may be off by two > pixels. What does (frame-text-height) return for the first and the > second frame? 1260 for both. > Also I hope you didn't get the GTK assertion failure. > Indeed, I do not. > And how does removing the menubar behave? > When I do M-x menu-bar-mode the first time it has no effect, as Emacs considers the menu bar to be currently enabled, so it disables it. After that, toggling the menu bar works as expected, and the window gets taller each time it is enabled, and shorter (by the same amount) each time it is disabled. Now something completely different. A couple of years ago I noticed > that our size hints calculations are fundamentally wrong. I tried to > fix them and I attach some parts of that fix together with the previous > changes I proposed. Attached as size_hints.diff. If the patch does not > apply, complain. I edited it by hand to exclude other changes I made > and I might have made mistakes. Again I'm interested in the history of > the second frame. > OK, running with just this patch (which applies fine), and doing the history test, the history of the second frame is: Frame size history of # x_create_frame_1 (5), TS=80x25~>1280x875, NS=80x25~>1296x875, IS=80x25~>1296x875, MS=32x70 IH IV gui_figure_window_size (5), TS=1280x875~>1280x1260, TC=80x25~>80x36, NS=1296x875~>1296x1260, IS=1296x875~>1296x1260, MS=32x70 IH IV scroll-bar-width (3), NS=1296x1260~>1328x1260, IS=1296x1260~>1328x1260, MS=160x175 scroll-bar-height (3), MS=160x175 x_create_frame_2 (0), MS=160x175 xg_frame_set_char_size, invisible, PS=1328x1260, XS=1328x1260, DS=1328x1260 xg_frame_set_char_size (5), MS=32x70 IH IV x_make_frame_visible MapNotify, not hidden & not iconified, PS=1328x1260, DS=1328x1260 ConfigureNotify, PS=1328x1260, XS=400x376, DS=1328x1260 xg_frame_resized, rejected, PS=1328x1260, XS=400x376, DS=664x630 menu-bar-lines (2), MS=160x175 xg_frame_set_char_size, visible, PS=1328x1260, XS=1328x1260, DS=1328x1260 ConfigureNotify, PS=1328x1260, XS=1328x1260, DS=1328x1260 xg_frame_resized, rejected, PS=1328x1260, XS=1328x1260, DS=664x655 tool-bar-lines (2), MS=160x175 xg_frame_set_char_size, visible, PS=1328x1260, XS=1328x1260, DS=1328x1260 ConfigureNotify, PS=1328x1260, XS=1328x1260, DS=1328x1260 xg_frame_resized, rejected, PS=1328x1260, XS=1328x1260, DS=664x696 set_window_configuration (4), MS=160x175 IH IV The second window is the same size as the first. -- https://rrt.sc3d.org --00000000000053b4950621b36cc8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've removed the patch to frame.c, and I'= m running with:

emacs = -Q =C2=A0--eval "(setq default-frame-alist '((menu-bar-lines . 0))= )"

On Mon, 9 Sept 2024 at 17:52, mar= tin rudalics <rudalics@gmx.at>= wrote:

The = result is not yet what I hoped for.=C2=A0 We reject two ConfigureNotify
events but the ensuing xg_frame_set_char_size calls do not get us a
ConfigureNotify we'd accept.=C2=A0 IIUC the final height may be off by = two
pixels.=C2=A0 What does (frame-text-height) return for the first and the second frame?
= 1260 for both.
=C2=A0
=C2=A0 Also I hope you didn't get the GTK assertion failure.=

Indeed, I do not.
=C2=A0
And how does removing the menubar behave?

When I do M-x menu-bar-mode the first time it has no = effect, as Emacs considers the menu bar to be currently enabled, so it disa= bles it.

After that, t= oggling the menu bar works as expected, and the window gets taller each tim= e it is enabled, and shorter (by the same amount) each time it is disabled.=

Now something completely different.=C2=A0 A couple of years ago I noticed that our size hints calculations are fundamentally wrong.=C2=A0 I tried to<= br> fix them and I attach some parts of that fix together with the previous
changes I proposed.=C2=A0 Attached as size_hints.diff.=C2=A0 If the patch d= oes not
apply, complain.=C2=A0 I edited it by hand to exclude other changes I made<= br> and I might have made mistakes.=C2=A0 Again I'm interested in the histo= ry of
the second frame.

OK, running with just this patch (which applies fine), and doing t= he history test, the history of the second frame is:

Frame size history of #<frame =C2=A0*Mini= buf-1* 0x6253825731d0>
x_create_frame_1 (5), TS=3D80x25~>1280x875,= NS=3D80x25~>1296x875, IS=3D80x25~>1296x875, MS=3D32x70 IH IV
gui_= figure_window_size (5), TS=3D1280x875~>1280x1260, TC=3D80x25~>80x36, = NS=3D1296x875~>1296x1260, IS=3D1296x875~>1296x1260, MS=3D32x70 IH IV<= br>scroll-bar-width (3), NS=3D1296x1260~>1328x1260, IS=3D1296x1260~>1= 328x1260, MS=3D160x175
scroll-bar-height (3), MS=3D160x175
x_create_f= rame_2 (0), MS=3D160x175
xg_frame_set_char_size, invisible, PS=3D1328x12= 60, XS=3D1328x1260, DS=3D1328x1260
xg_frame_set_char_size (5), MS=3D32x7= 0 IH IV
x_make_frame_visible
MapNotify, not hidden & not iconifie= d, PS=3D1328x1260, DS=3D1328x1260
ConfigureNotify, PS=3D1328x1260, XS=3D= 400x376, DS=3D1328x1260
xg_frame_resized, rejected, PS=3D1328x1260, XS= =3D400x376, DS=3D664x630
menu-bar-lines (2), MS=3D160x175
xg_frame_se= t_char_size, visible, PS=3D1328x1260, XS=3D1328x1260, DS=3D1328x1260
Con= figureNotify, PS=3D1328x1260, XS=3D1328x1260, DS=3D1328x1260
xg_frame_re= sized, rejected, PS=3D1328x1260, XS=3D1328x1260, DS=3D664x655
tool-bar-l= ines (2), MS=3D160x175
xg_frame_set_char_size, visible, PS=3D1328x1260, = XS=3D1328x1260, DS=3D1328x1260
ConfigureNotify, PS=3D1328x1260, XS=3D132= 8x1260, DS=3D1328x1260
xg_frame_resized, rejected, PS=3D1328x1260, XS=3D= 1328x1260, DS=3D664x696
set_window_configuration (4), MS=3D160x175 IH IV=

The second window is = the same size as the first.

--
--00000000000053b4950621b36cc8--