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 17:45:25 +0100 Message-ID: References: <0a6dc056-4950-0c3b-0d0a-733cc0ecddab@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="3440"; 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 18:57:11 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 1ldFP4-0000oB-Eu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 18:57:11 +0200 Original-Received: from localhost ([::1]:40730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldFP3-0008CG-H9 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 12:57:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldFEI-0004dt-Gl for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 12:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldFEI-0008JU-7N for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 12:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldFEI-0004p1-5k for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 12:46: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 16:46: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.161997393918528 (code B ref 48162); Sun, 02 May 2021 16:46:02 +0000 Original-Received: (at 48162) by debbugs.gnu.org; 2 May 2021 16:45:39 +0000 Original-Received: from localhost ([127.0.0.1]:43658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFDu-0004om-PG for submit@debbugs.gnu.org; Sun, 02 May 2021 12:45:39 -0400 Original-Received: from outbound.soverin.net ([116.202.65.218]:37569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFDr-0004og-Oq for 48162@debbugs.gnu.org; Sun, 02 May 2021 12:45:37 -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 6032760109; Sun, 2 May 2021 16:45:29 +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=1619973928; bh=Pf6cCsRhhkAPfoC46khpB9VYxDqmmt4gPl3gSms+hJ0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Nu4g8mJUfOiECtBkanQh/lLdxOpt8C82p/qynD3omK+rssc4CI9V73gFelBaIlpws 5O9jkdIKel6KNsWvSIx8mvg/dXnmeSuduREumk/KI1R99L3se0i3Mgqt62pyTfyW7r g3oE5bfxHRJR1f4gzPZuOD/F+KxY0KGl/d+mlQ06Vm1sE314OcLgvfygyX6fepChib QnHFhDI+BHLu6ei93GzvD0nTAzPXClWMyFWXLyVEK7nsNAN4H8jie9pJn6dX+4yqkz gcOxAbvBKRfhtpp/kj9nMhFtnH6lKqsQD25YD0cRZ8+b3AOA4D3E9Je+T3H/D3FC2e JGD8ZNxUgo0EQ== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.94) (envelope-from ) id 1ldFDh-0004nN-Eu; Sun, 02 May 2021 17:45:25 +0100 Mail-Followup-To: Alan Third , martin rudalics , 48162@debbugs.gnu.org, pankaj@codeisgreat.org Content-Disposition: inline In-Reply-To: <0a6dc056-4950-0c3b-0d0a-733cc0ecddab@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:205440 Archived-At: On Sun, May 02, 2021 at 06:12:45PM +0200, martin rudalics wrote: > > This is occurring on MacOS build. Branch: master. > > Steps: > > 1. ./src/emacs -Q > > 2. M-x set-frame-width RET 160 RET > > > > Result: Frame size is increased but mode-line still has original width. > > Could you please try the patch below. > > Thanks, martin > > > diff --git a/src/nsterm.m b/src/nsterm.m > index 6e7ab1266b..b089146e64 100644 > --- a/src/nsterm.m > +++ b/src/nsterm.m > @@ -7310,9 +7310,9 @@ - (void)viewDidResize:(NSNotification *)notification > > /* Don't want to do anything when the view size hasn't changed. */ > if ((oldh == newh && oldw == neww) > - || (emacsframe->new_size_p > - && newh == emacsframe->new_height > - && neww == emacsframe->new_width)) > + && (!emacsframe->new_size_p > + || (newh == emacsframe->new_height > + && neww == emacsframe->new_width))) > { > NSTRACE_MSG ("No change"); > return; 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. -- Alan Third