Fix crash when mousing over code-preview-window with focus-follows-mouse enabled.
cherry-picked from f32b83b3c