Fixed cursor related bug in windowed mode