Prevent a glitch when window is maximized on windows