Subject: bug#73559: [PATCH] fix NS build focus-in event processing

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 Sep 2024 20:40:57 +0300

> Date: Mon, 30 Sep 2024 10:05:09 -0700
> From: Daniel Colascione <[email-masked]>
> CC: [email-masked], [email-masked]
> 
> It's not that the NS pselect waits too long. It's that it doesn't know to wake up. The focus event is delivered to Emacs by NS as a callback. Unless that callback, one way or another, takes some action to wake up the event loop, nothing gets processed. On Windows, we drain the event queue as a side effect of the message pump, whereas on NS there doesn't seem to be a separate pump that works this way -- just a callback.

What about making pselect wait on one more descriptor, to which the
callback could then write?