From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#48162: 28.0.50; Resizing using set-frame-width doesn't expand mode-line Date: Sun, 2 May 2021 18:18:05 +0100 Message-ID: References: <0a6dc056-4950-0c3b-0d0a-733cc0ecddab@gmx.at> <28c3ab57-5735-58fb-8008-dbb1b57c88f6@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pankaj@codeisgreat.org, 48162@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 02 19:23:38 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 1ldFog-0009QN-O8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 19:23:38 +0200 Original-Received: from localhost ([::1]:48676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldFof-0007wj-Qk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 13:23:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldFkE-0004SP-Gw for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 13:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldFkE-0003oQ-8P for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldFkE-0007JV-4F for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 13:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 May 2021 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48162 X-GNU-PR-Package: emacs Original-Received: via spool by 48162-submit@debbugs.gnu.org id=B48162.161997590028105 (code B ref 48162); Sun, 02 May 2021 17:19:02 +0000 Original-Received: (at 48162) by debbugs.gnu.org; 2 May 2021 17:18:20 +0000 Original-Received: from localhost ([127.0.0.1]:43806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFjX-0007JF-OW for submit@debbugs.gnu.org; Sun, 02 May 2021 13:18:20 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:54209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFjT-0007J9-Oi for 48162@debbugs.gnu.org; Sun, 02 May 2021 13:18:18 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 731AD60109; Sun, 2 May 2021 17:18:09 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1619975888; bh=jp+BB96HRY4lvhgTlnvZYC4lDsw879cBRM6+DHFkRE8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MDLhcQ4+AJ64M1cG1M+sBNVbbCFnPWQJEffV/Hg1SYuGJml8VJg3Ie5GRUu6AKxCM vmZCPcpH1Z11TUL119Czl7/3FEHu+C0k5Tn2QqCbGjxhlfcTznMCbLRrI3hqxg/HTE wohicIF4RbxO4KxE05efCnQV0RvqmCIZ0tcrSTz+qmUDln8EZA8r2gJ1zBzbiYSAtt mF/Mhw89TgYwihLtOy6JNSn8D3EUXmOnFt794d7AFOiZsoOVh0/0UXy3QZgI3AQnF1 Hsn6GReWoMQeMKBQy6LY1vcnDGJx1MRdl972Uxiw/kGDeAsuotd1UW06CzSiTzcfrB REq1fmlK4OhNA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94) (envelope-from ) id 1ldFjJ-0004uN-M2; Sun, 02 May 2021 18:18:05 +0100 Mail-Followup-To: Alan Third , martin rudalics , 48162@debbugs.gnu.org, pankaj@codeisgreat.org Content-Disposition: inline In-Reply-To: <28c3ab57-5735-58fb-8008-dbb1b57c88f6@gmx.at> 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:205444 Archived-At: On Sun, May 02, 2021 at 06:57:08PM +0200, martin rudalics wrote: > > This patch reintroduces the infinite loop I was trying to avoid. > > > > viewDidResize is called every time the view's "frame" is touched. Most > > of the time this happens when nothing has changed, but calling > > change_frame_size, even when nothing has changed, appears to cause the > > toolbar to redraw, which causes viewDidResize to be called again, and > > so on ad infinitum. > > > > So I put in the check whether the new frame size that's reported is > > actually the same as the previous frame size, and if so do nothing. > > Then realised that I need to check the new_height and new_width > > settings in case the change is already pending. > > > > I'm not sure where new_size_p comes into it, perhaps we don't even > > need to check it in viewDidResize, because all we care about is the > > final outcome? > > > > Maybe this really isn't the way to do it and I need to keep track of > > the frame size separately, which is something I was hoping to avoid. > > new_size_p true means that Emacs has already received a resize event for > this frame but was not yet able to process it. So the additional > > || (newh == emacsframe->new_height > && neww == emacsframe->new_width))) > > in that case should "do nothing" when "nothing has changed". Where does > my reasoning go wrong? I'm not sure. I was hoping you were going to tell me where I'm going wrong! :) The only thing I can see is that in order to go into the block and return when new_size_p is false requires newh == oldh == new_height. And the same with width. Should it be this? if ((oldh == newh && oldw == neww && !emacsframe->new_size_p) || (newh == emacsframe->new_height && neww == emacsframe->new_width)) But I'm still not sure. If we have a change pending and the WM sends another change through, should we call change_frame_size with the new sizes? Perhaps it just needs to look like this? if ((oldh == newh && oldw == neww) || (newh == emacsframe->new_height && neww == emacsframe->new_width)) This is hard, because I can't replicate either of the reported bugs and I suspect my reasoning is very off here. -- Alan Third