I use the NS builds, both as my production (now 30.1) and from master, and I do not see this behavior.  Do you have implied window selection features enabled like focus-follows-mouse or mouse-autoselect-window?  Do you use any mac applications or helpers that might be interfering?

On Thu, Feb 27, 2025 at 10:52 PM Daniel Colascione <dancol@dancol.org> wrote:
Say we have a NS Emacs frame with two windows --- let's say L and R.
We select L, then switch to another app on the OS.  Then we click on the
Emacs window in the area owned by R.  I observe Emacs being focused but
the selected window being L!  If I click in exactly the same spot again,
*then* R is selected.  But I need two clicks where one should suffice.