Hmm, I don't think this belongs to winex11, also why is this necessary? How can the window be active already?
With this MR, after calling NtUserSetActiveWindow(), another WM_WINE_WINDOW_STATE_CHANGED is posted to the message queue (or there is an existing WM_WINE_WINDOW_STATE_CHANGED), then the current WM_WINE_WINDOW_STATE_CHANGED handling is done. When handling the next WM_WINE_WINDOW_STATE_CHANGED, the window would have been activated so we shouldn't activate it again. This is also needed to avoid infinite WM_WINE_WINDOW_STATE_CHANGED messages.
if it is important that it gets activated before being restored we should do it unconditionally.
We need to be careful and not introduce duplicate activate message sequences. On Windows, when restoring a window, WM_ACTIVATE is sent only once before WM_SYSCOMMAND SC_RESTORE. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10725#note_137720