Quick fix for the messagebox popup (should pop up only if the window is focused)