Skip to content

Commit

Permalink
No cursor lock when window inactive (#5754)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed May 13, 2017
1 parent 0d4d35a commit febd07f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game.cpp
Expand Up @@ -2956,7 +2956,8 @@ void Game::toggleFullViewRange()

void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
{
if ((device->isWindowActive() && !isMenuActive()) || random_input) {
if ((device->isWindowActive() && device->isWindowFocused()
&& !isMenuActive()) || random_input) {

#ifndef __ANDROID__
if (!random_input) {
Expand All @@ -2981,8 +2982,7 @@ void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
device->getCursorControl()->setVisible(true);
#endif

if (!m_first_loop_after_window_activation)
m_first_loop_after_window_activation = true;
m_first_loop_after_window_activation = true;

}
}
Expand Down

1 comment on commit febd07f

@HybridDog
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the window isn't focused, rendering could be interrupted…

Please sign in to comment.