No cursor lock when window inactive (#5754)

This commit is contained in:
SmallJoker 2017-05-13 17:42:42 +02:00 committed by GitHub
parent 0d4d35ab93
commit febd07fc0d

@ -2956,7 +2956,8 @@ void Game::toggleFullViewRange()
void Game::updateCameraDirection(CameraOrientation *cam, float dtime) void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
{ {
if ((device->isWindowActive() && !isMenuActive()) || random_input) { if ((device->isWindowActive() && device->isWindowFocused()
&& !isMenuActive()) || random_input) {
#ifndef __ANDROID__ #ifndef __ANDROID__
if (!random_input) { if (!random_input) {
@ -2981,7 +2982,6 @@ void Game::updateCameraDirection(CameraOrientation *cam, float dtime)
device->getCursorControl()->setVisible(true); device->getCursorControl()->setVisible(true);
#endif #endif
if (!m_first_loop_after_window_activation)
m_first_loop_after_window_activation = true; m_first_loop_after_window_activation = true;
} }