https://bugs.winehq.org/show_bug.cgi?id=51194
--- Comment #1 from Brendan Shanks bshanks@codeweavers.com --- Additionally, the window does get correctly foregrounded without a Sleep() or additional SetWindowPos() call.
This appears to be luck: without any extra time after the SetWindowPos() call, the window has not had any time to be shown (and the applicationWill/DidBecomeActive / APP_ACTIVATED events sent). When SetFocus() is called, the app isn't active, so makeKeyWindow: doesn't take effect immediately. windowDidBecomeKey: is called later, not under the call stack of makeFocused: / makeKeyWindow:, so the logic in those commits doesn't apply.