diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2017-05-13 17:42:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-13 17:42:42 +0200 |
commit | febd07fc0dea400db17ab84dd9fcb4d64e3ce9e3 (patch) | |
tree | 942c59f2c3300edde3aaeaa35e057fc765da6dee | |
parent | 0d4d35ab930ecb5b313f74ae430edddd0ee79d4d (diff) | |
download | minetest-febd07fc0dea400db17ab84dd9fcb4d64e3ce9e3.tar.gz minetest-febd07fc0dea400db17ab84dd9fcb4d64e3ce9e3.tar.bz2 minetest-febd07fc0dea400db17ab84dd9fcb4d64e3ce9e3.zip |
No cursor lock when window inactive (#5754)
-rw-r--r-- | src/game.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp index f237a87aa..f079f836b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -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) { @@ -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; } } |