I am having the same problem of at random times not being able to set focus to another application away from UE5.0.3 Editor on MacBook M1 Pro Monterey 12.6 (21G115).
If I select another application window, focus immediately pops back to UE. If I select a window behind UE, the UE window immediately pops back in front. Once this starts happening, it stays in this mode. As others have said, stopping and starting UE solves it temporarily.
Very annoying and causes loss of focus (Hahaha) / productivity. We seriously need a fix for this issue because it is frustrating and time consuming to keep having to stop and start the UE just to select another window (Browser, Rider, etc).
Are only some of us having this issue on the Mac or is it a widespread issue? It would help to know if it is just some of us having an issue due to a Mac configuration issue or something, so we can try to find out what we have in common leading to a fix.
Seems like it could possibly have something to do with “Auto Save” making it seem random because when I do a “Save All” in the editor it sometimes happens immediately after the “Save All” finishes.
Found that it sometimes fixes itself without restarting the UE if I left mouse click quickly and repeatedly in a text entry field in another application window (for example the URL field in a Browser window). Not sure it this works all the time or not, but it has been working for me the last few days at least. Hope this helps some of you.