elmindreda/glfw — pull request #40 by nilium (2013-02-22 07:14:50+00:00)
Title: Add GLFW_CURSOR_HIDDEN for Cocoa windows (#2)

Alright, take two. Same case as last time: trying to implement `GLFW_CURSOR_HIDDEN` for Cocoa. This time, it shouldn't result in odd cursor issues with unbalanced hide/unhide calls since the app delegate now manages cursor visibility. This way, assuming the app delegate doesn't change mid-application (which it shouldn't, I think), nothing unusual should happen and cursor visibility is simplified instead of depending on a counter.

Seems to work as expected in my own fiddly tests and using the multiple windows test in the repo.

Currently, cursor visibility will only change while the cursor is in a window with the `GLFW_CURSOR_HIDDEN` mode set _and_ the window is the key window (that is, it's the one receiving keyboard input). This seems like the best way to handle it, and I'm not sure how complex it'd be to try to apply it to non-key windows.