Fix crash when dragging mouse and switching from fullscreen to windowed
mode