This is in fact what is happening - window focus/activation can be tricky so the set focus routine in mIRC has to take into account a number of situations. The resetting of the window is necessary in this case however it should be quick and barely visible. I'm not sure why it would take 500ms - are you displaying a background picture in the window by any chance?