This reverts commit f82b115dfcf3eefbbb533d31976d178e21bf1237. f82b115d was intended to fix SDL3 applications unexpectedly switching to the native display mode. However, after further investigations, the bug is caused by other issues rather than the NtUserSetActiveWindow() call. In fact, by tracing the message sequence when restoring a window, there should be a WM_ACTIVATE message before WM_SYSCOMMAND SC_RESTORE. Fix Warhammer: Vermintide 2 (552500) failing to enter fullscreen mode after focus loss. The game needs a WM_ACTIVATE message before WM_SYSCOMMAND SC_RESTORE. The SDL3 application unexpectedly switches to the native display mode bug is caused by the following: **(1) The 16-bit display mode format gets overwritten** Please see https://gitlab.winehq.org/wine/wine/-/merge_requests/10697 for details. **(2) Window managers restore minimized windows with the current display mode** For example, an SDL3 game on a 1920x1080 monitor uses 1024x768 display mode. When the game gets minimized, say by Alt+Tab, it will set the display mode back to 1920x1080. When the game window gets restored, the window manager will resize the window to 1920x1080 because the window still has __NET_WM_STATE_FULLSCREEN set even though it's minimized. So a WM_WINDOWPOSCHANGE (1920x1080) is sent to the game window. The game processes the WM_WINDOWPOSCHANGE and changes to the previous 1024x768 display mode. So a WM_WINDOWPOSCHANGE (1024x768) will be sent later once the WM finishes processing the display change event. However, there might be a delay between the WM_WINDOWPOSCHANGE (1920x1080) and WM_WINDOWPOSCHANGE (1024x768). So if the game finishes WM_WINDOWPOSCHANGE (1920x1080) and it can't find more messages, then it will trigger a render update and use the current window size (1920x1080) to adjust the display mode, causing it to revert to the native display mode instead of the specified one. See SDL3 testwm.c main message loop for example. The root cause is the difference in the behavior of WM on Linux and Windows. Windows still uses the old window size when restoring a window, even though the display mode is changed. The presence of `__NET_WM_STATE_FULLSCREEN` on Linux makes the WM choose the current display size instead of the previous window size. I tried removing `__NET_WM_STATE_FULLSCREEN` for a window when it gets minimized. But it will trigger unexpected size changes because removing `__NET_WM_STATE_FULLSCREEN` causes WMs to restore the window to its previous size before fullscreen. Unfortunately, I haven't thought of a reliable way to fix this. Anyway, it did prove that it's not related to the NtUserSetActiveWindow() call. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10699