New window in WPF application sometimes blocks mouse events
<p>I have a WPF application in which we sometimes open new windows to display messages (modal in this case) or open editors for sub-items.</p>

<p>Sometimes (I found no pattern in the frequency and other circumstances) the new window is displayed correctly but only accepts keyboard input. All mouse input is ignored until you de-focus the application (for example by clicking on the task bar) and focusing it again. After the application got the focus back mouse events are accepted again.
This is especially annoying for message boxes. I don't have a clue what happens there, debugging it is also quite difficult because as soon as you leave the applications focus it starts working again.</p>

<p>I just tried the suggestion with calling Focus() on Loaded but this did not help. However I tried setting the State to <code>Minimized</code> then <code>Normal</code> hoping that this emulates the de-focus. This did work but not because of minimizing it because I put a one second sleep after minimizing so I can see the effect. Strangely it works if I leave only the sleep (50ms is not enough, 100ms is sufficient)... 
Is this some strange kind of timing effect? This could explain the randomness of it?</p>

<p>Any suggestions on this?</p>