The problem happens because, on some OSs, `wm->winactive` is `nullptr`. Another problem is that `wm->winactive->eventstate` sometimes does not update when the mouse moves. This happens in some OSs when the cursor is not over the active window. So the snap cursor state doesn't update. The solution is to use the `eventstate` of the window in the context (`CTX_wm_window(C)->eventstate`). This matches other parts where `eventstate` is used. Pull Request: https://projects.blender.org/blender/blender/pulls/120475