Mainly looking for feedback. When destroying an active window it sometimes happens that X11 sends a PropertyNotify with _NET_ACTIVE_WINDOW set to the destroyed window. This causes Wine to set the active window to the desktop because _NET_ACTIVE_WINDOW is set to a non-wine window (however it's a destroyed wine window that has not been completely destroyed in X11 side) when it should set it to the previous process window. I wrote a test that reproduces this https://gitlab.winehq.org/tati/draft-tests/-/blob/master/app_activation_when... In Windows the program never exits because when destroying the second window it activates the first window. In Wine it sometimes exits because it changes the active window to the desktop for a moment, so WM_ACTIVATEAPP is sent with wparam of 0. Because this bug isn't consistent, I was not able to write a Wine test. I am not entirely sure if calling XSync is a good solution, so I would like to get some feedback on this. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10817