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.devel Subject: Re: Proposing changes to adjust_frame_size Date: Sun, 16 May 2021 10:29:34 +0200 Message-ID: <65f5a80d-727e-1768-6814-d98a9c0f7f68@gmx.at> References: <69a5e928-2998-f776-fa0d-f35e6ab1e65d@gmx.at> <52a5361a-451e-7167-edfd-09066dfdcc3e@gmx.at> <875yzt907k.fsf@gnu.org> <0633b8ac-de8e-b57a-f3f4-804c5efb009a@gmx.at> <874kfdtj5l.fsf@gnu.org> <37f3ce19-d858-111e-a5aa-06c24803e17b@gmx.at> <87v97tvt7e.fsf@gnu.org> <726883d4-8d13-a3cb-30b7-a74c4b44f8ed@gmx.at> <87a6p3iv9q.fsf@gnu.org> <48753133-11a3-a21f-a1f9-4e58508079ac@gmx.at> <36f3b7b6-b81c-2e89-99c8-0a8837ef7869@gmx.at> <874kfabe7j.fsf@gnu.org> <1de34884-dfa3-92ba-8c6d-d256dcbb5d2b@gmx.at> <871raebctt.fsf@gnu.org> <87sg2tr4u4.fsf@gnu.org> <54259dfb-3ca4-f3b0-8344-f3de5106d286@gmx.at> <875yzof0yi.fsf@gnu.org> <1787102b-e076-825d-4f47-44d3d15fbdba@gmx.at> <875yznkacy.fsf@gnu.org> <87y2cjm4ew.fsf@gnu.org> 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="21913"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Garjola Dindi , emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 16 10:31:21 2021 Return-path: Envelope-to: ged-emacs-devel@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 1liCBE-0005aX-II for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 10:31:20 +0200 Original-Received: from localhost ([::1]:41000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liCBD-0002qB-Gm for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 04:31:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liC9g-00020I-5R for emacs-devel@gnu.org; Sun, 16 May 2021 04:29:45 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:58883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liC9d-00081c-Mt; Sun, 16 May 2021 04:29:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1621153777; bh=+hDElrL2nydjvggAzuYwXnUbkTXkLqLGxE/J1kmsCvI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=bdif+ZfVUro4tHzXNl3ucWrSyt41xx7YhH03qkhXHXqr9HUuJJaRy7jDuHG2Q5AGL sqm2gWzhSGgVNWbRuDakmOQfJ4tnmvranY5XUrAJfFr9RUdHKCJun/b5uLkyBYCrx9 1UFuHoZTW4JmKNlRgEPzlI5QrP3LtWEFvAmkUB2w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.102]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MgNh7-1lHMqs0xqR-00hrN4; Sun, 16 May 2021 10:29:37 +0200 In-Reply-To: <87y2cjm4ew.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:sh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9N2a+jBgJtXQY6bg0D Received-SPF: pass client-ip=212.227.15.15; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269331 Archived-At: > With --load repro.el the initial frame has: > > --8<---------------cut here---------------start------------->8--- > Frame size history of # > x_create_frame_1 (5), TS=80x25~>640x525, NS=80x25~>656x525, IS=80x25~>656x525, MS=16x42 IH IV > gui_figure_window_size (5), TS=640x525~>640x756, TC=80x25~>80x36, NS=656x525~>656x756, IS=656x525~>656x756, MS=16x42 IH IV > scroll-bar-width (3), NS=656x756~>672x756, IS=656x756~>672x756, MS=80x105 16 pixels for the scroll bar, we don't know yet that it will be turned off. > scroll-bar-height (3), MS=80x105 > menu-bar-lines (2), MS=80x105 > x_create_frame_2 (0), MS=80x105 > xg_frame_set_char_size, invisible, PS=672x756, XS=672x756, DS=672x756 > xg_frame_set_char_size (5), MS=16x42 IH IV > MapNotify, not hidden & not iconified, PS=672x756, DS=672x756 > ConfigureNotify, PS=672x756, XS=672x756, DS=672x756 This was a ConfigureNotify for the frame size we asked for. We don't pass it on to change_frame_size since it's the size we have set already. > xg_frame_resized, unchanged, PS=672x756, XS=672x756 > ConfigureNotify, PS=672x756, XS=1594x851, DS=672x756 And this was a ConfigureNotify for the frame size the WM allots to us. This time it gives you the entire display - 1594x851 native pixels, right?. > xg_frame_resized, changed, PS=672x756, XS=1594x851 > change_frame_size_1, delayed, PS=672x756, XS=1594x851, DS=672x756 > change_frame_size (5), TS=640x756~>1562x851, TC=80x36~>195x40, NS=672x756~>1594x851, IS=672x756~>1594x851, MS=16x42 IH IV Here Emacs should have dealt with the size we got from the WM resulting in 195x40 characters. > tool-bar-lines (2), MS=80x105 IH IV > menu-bar-lines (2), MS=80x105 IH IV > vertical-scroll-bars (3), TS=1562x851~>1578x851, TC=195x40~>197x40, MS=80x105 IH IV Here we presumably processed the removal of the various bars. > size (1), TS=1578x851~>720x1050, TC=197x40~>90x50, NS=1594x851~>736x1050, IS=1594x851~>736x1050, MS=80x105 And here the 90x50 characters size request from `default-frame-alist' kicked in. > xg_frame_set_char_size, visible, PS=1594x851, XS=736x1050, DS=736x1050 > ConfigureNotify, PS=1594x851, XS=1594x878, DS=736x1050 Here we got a ConfigureNotify of 1594x878 native pixels. These are 17 pixels more than before, probably from the recovered menu bar pixels (leaving the outer frame size unchanged). > xg_frame_resized, changed, PS=1594x851, XS=1594x878 > change_frame_size_1, delayed, PS=1594x851, XS=1594x878, DS=736x1050 > change_frame_size (5), TS=1578x851~>1578x878, TC=197x40~>197x41, NS=1594x851~>1594x878, IS=1594x851~>1594x878, MS=16x42 IH IV And here we processed the ConfigureNotify, resulting in 197x41 characters. > --8<---------------cut here---------------end--------------->8--- The problem with this history is that the focus/resize is somewhere processed in it but I cannot tell where. I suppose that at the time the 1594x878 pixels appear in the history, everything looks good, that is the menu bar has disappeared probably after the frame has got focus. >> After that do >> >> (setq frame-size-history '(100)) >> >> run C-x 5 2 and again post what `frame--size-history' returns. > > --8<---------------cut here---------------start------------->8--- > Frame size history of # > x_create_frame_1 (5), TS=80x25~>640x525, NS=80x25~>656x525, IS=80x25~>656x525, MS=16x42 IH IV > gui_figure_window_size (5), TS=640x525~>720x1050, TC=80x25~>90x50, NS=656x525~>736x1050, IS=656x525~>736x1050, MS=16x42 IH IV > scroll-bar-width (3), NS=736x1050~>752x1050, IS=736x1050~>752x1050, MS=80x105 16 pixels for the scroll bar with `scroll-bar-mode' turned off? Looks silly and is probably the cause of the "scrollbar which won't vanish except by M-x scroll-bar-mode RET twice". > scroll-bar-height (3), MS=80x105 > x_create_frame_2 (0), MS=80x105 > xg_frame_set_char_size, invisible, PS=752x1050, XS=752x1050, DS=752x1050 > xg_frame_set_char_size (5), MS=16x42 IH IV > x_make_frame_visible > MapNotify, not hidden & not iconified, PS=752x1050, DS=752x1050 > ConfigureNotify, PS=752x1050, XS=752x1050, DS=752x1050 > xg_frame_resized, unchanged, PS=752x1050, XS=752x1050 > ConfigureNotify, PS=752x1050, XS=794x878, DS=752x1050 > xg_frame_resized, changed, PS=752x1050, XS=794x878 > change_frame_size_1, delayed, PS=752x1050, XS=794x878, DS=752x1050 > change_frame_size (5), TS=720x1050~>762x878, TC=90x50~>95x41, NS=752x1050~>794x878, IS=752x1050~>794x878, MS=16x42 IH IV This looks normal again just that I don't have any idea where this > set_window_configuration (4), MS=80x105 IH IV comes from. > --8<---------------cut here---------------end--------------->8--- > > And now the same with the repro.el where the default-frame-alist setting > is commented out, and thereby it works all fine, i.e., the initial frame > has tool/menu/scrollbars disabled and the second frame has, too. > > Initial frame: > > --8<---------------cut here---------------start------------->8--- > Frame size history of # > x_create_frame_1 (5), TS=80x25~>640x525, NS=80x25~>656x525, IS=80x25~>656x525, MS=16x42 IH IV > gui_figure_window_size (5), TS=640x525~>640x756, TC=80x25~>80x36, NS=656x525~>656x756, IS=656x525~>656x756, MS=16x42 IH IV > scroll-bar-width (3), NS=656x756~>672x756, IS=656x756~>672x756, MS=80x105 > scroll-bar-height (3), MS=80x105 > menu-bar-lines (2), MS=80x105 > x_create_frame_2 (0), MS=80x105 > xg_frame_set_char_size, invisible, PS=672x756, XS=672x756, DS=672x756 > xg_frame_set_char_size (5), MS=16x42 IH IV > MapNotify, not hidden & not iconified, PS=672x756, DS=672x756 > ConfigureNotify, PS=672x756, XS=672x756, DS=672x756 > xg_frame_resized, unchanged, PS=672x756, XS=672x756 > ConfigureNotify, PS=672x756, XS=1594x851, DS=672x756 > xg_frame_resized, changed, PS=672x756, XS=1594x851 > change_frame_size_1, delayed, PS=672x756, XS=1594x851, DS=672x756 > change_frame_size (5), TS=640x756~>1562x851, TC=80x36~>195x40, NS=672x756~>1594x851, IS=672x756~>1594x851, MS=16x42 IH IV > tool-bar-lines (2), MS=80x105 IH IV > menu-bar-lines (2), MS=80x105 IH IV > vertical-scroll-bars (3), TS=1562x851~>1578x851, TC=195x40~>197x40, MS=80x105 IH IV No 90x50 request here. > ConfigureNotify, PS=1594x851, XS=1594x878 > xg_frame_resized, changed, PS=1594x851, XS=1594x878 > change_frame_size_1, delayed, PS=1594x851, XS=1594x878 > change_frame_size (5), TS=1578x851~>1578x878, TC=197x40~>197x41, NS=1594x851~>1594x878, IS=1594x851~>1594x878, MS=16x42 IH IV And everything looks like above. > --8<---------------cut here---------------end--------------->8--- >> Is this behavior new or did it already occur in Emacs 27? > > Yes, with my repro.el containing the `default-frame-alist' setting, the > initial frame has a menubar (until resize/focus), and the new frame > after C-x 5 2 has a scrollbar. And with Emacs 27 the initial frame did not have a menu bar initially and the new frame after C-x 5 2 did not have a scroll bar initially. Right? Did my latest commit (c18403302df3f07a7f94c3984d65b808fb40e8c1) in this area change anything in this regard? martin