-
-
Save lcd047/6f9655b95025934b7719086edea50d53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -urp openttd-1.7.0.old/src/video/sdl_v.cpp openttd-1.7.0/src/video/sdl_v.cpp | |
--- openttd-1.7.0.old/src/video/sdl_v.cpp 2017-05-12 19:57:29.568021877 +0300 | |
+++ openttd-1.7.0/src/video/sdl_v.cpp 2017-05-12 19:53:51.471029678 +0300 | |
@@ -13,6 +13,7 @@ | |
#include "../stdafx.h" | |
#include "../openttd.h" | |
+#include "../command_func.h" | |
#include "../gfx_func.h" | |
#include "../sdl.h" | |
#include "../rev.h" | |
@@ -584,6 +585,14 @@ int VideoDriver_SDL::PollEvent() | |
break; | |
case SDL_ACTIVEEVENT: | |
+ if (!_networking && _game_mode == GM_NORMAL && | |
+ (_pause_mode & PM_PAUSED_NORMAL) == PM_UNPAUSED && | |
+ (ev.active.state & SDL_APPACTIVE) && !ev.active.gain) { | |
+ DEBUG(driver, 1, "SDL: minimised window, pausing"); | |
+ DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE); | |
+ break; | |
+ } | |
+ | |
if (!(ev.active.state & SDL_APPMOUSEFOCUS)) break; | |
if (ev.active.gain) { // mouse entered the window, enable cursor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment