This is a revert of 2011 path: https://developer.blender.org/rB0b03268c17fb4e2b094a01f8b6f43947e2f0826e
At the time this was a solution to getting input to embedded blenderplayer, because at the time child windows could not be active.
Later, we changed the way that Windows were created and added the "dialog" variable, and at that time this code became unreachable. In a nutshell, we could only ever be passed two combinations of window arguments: (dialog and parentwindow), or (!notdialog and null), which mean this code is never touched. In fact, no windows had been created that were dialog so we had only ever had the one type in practice.
Now, very recently we are improving this code and allowing different types of windows, including children on top of parents. But this means that this code can now be called at times which stops input to all windows once a child window is opened. Without this code all windows work properly.