projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e52a5b
)
Pause the game when window loses focus, fixes #513
author
Tobias Markus
<tobbi@mozilla-uk.org>
Mon, 16 Mar 2015 21:46:22 +0000
(22:46 +0100)
committer
Tobias Markus
<tobbi@mozilla-uk.org>
Mon, 16 Mar 2015 21:46:22 +0000
(22:46 +0100)
src/supertux/screen_manager.cpp
patch
|
blob
|
history
diff --git
a/src/supertux/screen_manager.cpp
b/src/supertux/screen_manager.cpp
index
dd1cbf7
..
decc603
100644
(file)
--- a/
src/supertux/screen_manager.cpp
+++ b/
src/supertux/screen_manager.cpp
@@
-27,6
+27,7
@@
#include "supertux/console.hpp"
#include "supertux/constants.hpp"
#include "supertux/gameconfig.hpp"
+#include "supertux/game_session.hpp"
#include "supertux/globals.hpp"
#include "supertux/main.hpp"
#include "supertux/menu/menu_storage.hpp"
@@
-213,6
+214,12
@@
ScreenManager::process_events()
event.window.data2);
m_menu_manager->on_window_resize();
break;
+
+ case SDL_WINDOWEVENT_FOCUS_LOST:
+ if(GameSession::current() != NULL) {
+ GameSession::current()->toggle_pause();
+ }
+ break;
}
break;