I am confused about object's positions in window, view and screen.
Your player can have any position, like 0x0 or 999999x999999, doesn't matter. Same case with the view, they use "world coordinates".
Your mouse, however, can only be inside your screen, that is, your resolution (1280x1080 or whatever). So, if you use your player position in Mouse::setPosition(), you are using numbers way beyond your screen resolution, and that's bad.
So, you need to transform the coordinates, either using mapCoordsToPixel() or manually:
sf::Vector2f transformedPlayerPosition = window.mapCoordsToPixel( player.getPosition() , view );
sf::Mouse::setPosition( transformedPlayerPosition );
(Or something like that. I've never used mapCoordsToPixel()
)
Anyway, is it really necesary to move your mouse cursor? That seems annoying for the player. You could use another sprite or something instead of the mouse.