I use setMouseCursorVisible to hide to mouse cursor when it enters the SFML window. When set to false, the cursor is still visible when it hovers over the running window until it loses focus and gets it back. Only then the cursor remains hidden over the window.
Here's a small program showing this behavior on osx:
#include <SFML/Graphics.hpp>
int main(int, char const**)
{
sf::RenderWindow window(sf::VideoMode(1280, 1024), "SFML window");
window.setMouseCursorVisible(false);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed) {
window.close();
}
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
}
window.clear();
window.display();
}
return EXIT_SUCCESS;
}
I use the latest SFML github source.
Simply moving the mouse cursor over the dock then back over the window kicks in the cursor hide. Command+tab does the same as well.
The same issue can be observed in fullscreen video modes.