[shell] Implement snap-to-grid.

Somehow it got lost during the GLFW-to-SDL transition
[shell] Fix menu item hovering flickering