fix #1530

fixed the code that prioritize a video window when the user clicks on it