Skip to content

Commit

Permalink
[OS X] don't try hiding the mouse on OS X, it's not worth the hassle
Browse files Browse the repository at this point in the history
  • Loading branch information
mickelson committed Aug 1, 2015
1 parent 056f43c commit 302110a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/fe_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,20 @@ bool FeWindow::run()
{
int min_run;

#ifndef SFML_SYSTEM_MACOS
//
// Move the mouse to the bottom left corner so it isn't visible
// when the emulator launches. We don't do this on macs due to the
// hot corners.
//
sf::Vector2i reset_pos = sf::Mouse::getPosition();

sf::Vector2i hide_pos = getPosition();
hide_pos.x += getSize().x - 1;
hide_pos.y += getSize().y - 1;

sf::Mouse::setPosition( hide_pos );
#endif

#ifdef SFML_SYSTEM_LINUX
//
Expand Down Expand Up @@ -263,7 +270,9 @@ bool FeWindow::run()
sf::sleep( sf::milliseconds( 250 ) );
}

#ifndef SFML_SYSTEM_MACOS
sf::Mouse::setPosition( reset_pos );
#endif

return false;
}
Expand Down

0 comments on commit 302110a

Please sign in to comment.