GNU bug report logs - #48406
28.0.50; Emacs stuck in infinite loop in wait_reading_process_output when opening in fullscreen (NS)

Previous Next

Package: emacs;

Reported by: Illia Ostapyshyn <ilya.ostapyshyn <at> gmail.com>

Date: Thu, 13 May 2021 21:00:02 UTC

Severity: normal

Merged with 41055

Found in version 28.0.50

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 48406 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: Illia Ostapyshyn <ilya.ostapyshyn <at> gmail.com>, 48406 <at> debbugs.gnu.org
Subject: Re: 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
On Fri, May 14, 2021 at 10:32:56PM +0300, Andrii Kolomoiets wrote:
> Illia Ostapyshyn <ilya.ostapyshyn <at> gmail.com> 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




This bug report was last modified 4 years and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.