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#48406: 28.0.50; Emacs stuck in infinite loop in wait_reading_process_output when opening in fullscreen (NS) Date: Sat, 15 May 2021 23:47:18 +0100 Message-ID: References: <5E1B46C6-1359-4CCF-B4EF-5527FB915F93@gmail.com> 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="11831"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Illia Ostapyshyn , 48406@debbugs.gnu.org To: Andrii Kolomoiets Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 16 00:48: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 1li34s-0002s9-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 May 2021 00:48:10 +0200 Original-Received: from localhost ([::1]:37664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1li34r-00082H-N7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 May 2021 18:48:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1li34k-000827-KM for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 18:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1li34k-00009P-D2 for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 18:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1li34k-00027Z-AM for bug-gnu-emacs@gnu.org; Sat, 15 May 2021 18:48: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: Sat, 15 May 2021 22:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48406 X-GNU-PR-Package: emacs Original-Received: via spool by 48406-submit@debbugs.gnu.org id=B48406.16211188478109 (code B ref 48406); Sat, 15 May 2021 22:48:02 +0000 Original-Received: (at 48406) by debbugs.gnu.org; 15 May 2021 22:47:27 +0000 Original-Received: from localhost ([127.0.0.1]:49381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li34B-00026j-Dd for submit@debbugs.gnu.org; Sat, 15 May 2021 18:47:27 -0400 Original-Received: from [217.169.17.33] (port=54856 helo=breton.holly.idiocy.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li348-00026U-VY for 48406@debbugs.gnu.org; Sat, 15 May 2021 18:47:25 -0400 Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 67CBD202C11CA6; Sat, 15 May 2021 23:47:18 +0100 (BST) Mail-Followup-To: Alan Third , Andrii Kolomoiets , Illia Ostapyshyn , 48406@debbugs.gnu.org Content-Disposition: inline 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" Xref: news.gmane.io gmane.emacs.bugs:206625 Archived-At: On Sat, May 15, 2021 at 10:44:28PM +0300, Andrii Kolomoiets wrote: > Alan Third writes: > > > Now I've dug out my Mac I can confirm I see this hang as well. > > > > The problem is that we never reach the NS run loop and therefore > > windowDidEnterFullScreen is never called. > > > > This fixes it for me, but whether it's a good idea or not I don't know: > > > > - wait_reading_process_output (0, 300000000, 0, 1, Qnil, NULL, 0); > > + [NSApp run]; > > I really like this change. Using `wait_reading_process_output` to wait > for NS event was a bad idea. > > Though I don't understand why my setup isn't affected by this bug. I can only guess that for some reason your setup doesn't have these pending inputs that block ns_select. But even so I don't really understand what's going on as I thought if there were pending inputs then ns_read_socket would be called and clear them... > Alan, please install your patch. You know, I'm probably being stupid, but I can't for the life of me remember why we need to wait for the fullscreen transition to complete. I *thought* it was because we had a crash if we didn't, but if I remove the wait it all works just fine... It could be that it's pure chance I'm not seeing any problems, or that some other fix has fixed the crash, or that the older drawing scheme used before 10.14 has a problem and the new one doesn't... Or something else. Do you have any idea? I *do* remember that there was a pause required for the non-native fullscreen due to a crash, and I don't think that will have changed, except that I don't think I've heard from anyone still using 10.6 for a couple of years now. -- Alan Third