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: Fri, 14 May 2021 21:34:42 +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="37775"; 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 Fri May 14 22:35:18 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 1lheWj-0009c8-Ru for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 22:35:17 +0200 Original-Received: from localhost ([::1]:45610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lheWi-0000Oi-Ri for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 16:35:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lheWU-0000OZ-T8 for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 16:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lheWU-0005oO-5g for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 16:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lheWU-0002mC-3S for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 16:35: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: Fri, 14 May 2021 20:35: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.162102449410656 (code B ref 48406); Fri, 14 May 2021 20:35:02 +0000 Original-Received: (at 48406) by debbugs.gnu.org; 14 May 2021 20:34:54 +0000 Original-Received: from localhost ([127.0.0.1]:47148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lheWL-0002lo-R5 for submit@debbugs.gnu.org; Fri, 14 May 2021 16:34:54 -0400 Original-Received: from [217.169.17.33] (port=54728 helo=breton.holly.idiocy.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lheWJ-0002lX-M6 for 48406@debbugs.gnu.org; Fri, 14 May 2021 16:34:52 -0400 Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id F17E0202C1187D; Fri, 14 May 2021 21:34:42 +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:206560 Archived-At: On Fri, May 14, 2021 at 10:32:56PM +0300, Andrii Kolomoiets wrote: > Illia Ostapyshyn writes: > > > Executing like this doesn't work for me: > > > > emacs -Q --execute "(push '(fullscreen . fullboth) default-frame-alist)" > > > > I've tried recompiling emacs with you configure flags, same > > result. Could it be the OS version? I doubt it, I recall having this > > issue long time ago, but I bore with it instead of reporting. > > Well, I'm on macOS 11.3.1 now, recompiled Emacs with `make bootstrap` > still works fine. 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. It appears ns_select returns in this code: if (hold_event_q.nr > 0) { /* We already have events pending. */ raise (SIGIO); errno = EINTR; return -1; } hmmmm....... This fixes it for me, but whether it's a good idea or not I don't know: modified src/nsterm.m @@ -7876,6 +7876,7 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification NSTRACE ("[EmacsView windowDidEnterFullScreen:]"); [self windowDidEnterFullScreen]; in_fullscreen_transition = NO; + ns_send_appdefined (-1); } - (void)windowDidEnterFullScreen /* provided for direct calls */ @@ -7935,6 +7936,7 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification NSTRACE ("[EmacsView windowDidExitFullScreen:]"); [self windowDidExitFullScreen]; in_fullscreen_transition = NO; + ns_send_appdefined (-1); } - (void)windowDidExitFullScreen /* provided for direct calls */ @@ -7974,7 +7976,7 @@ - (void)waitFullScreenTransition while ([self inFullScreenTransition]) { NSTRACE ("wait for fullscreen"); - wait_reading_process_output (0, 300000000, 0, 1, Qnil, NULL, 0); + [NSApp run]; } #endif } -- Alan Third