aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/graphics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index 83a256f568..721cc54c90 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1377,6 +1377,10 @@ void OSystem_SDL::setMousePos(int x, int y) {
void OSystem_SDL::warpMouse(int x, int y) {
int y1 = y;
+ // Don't change mouse position, when mouse is outside of our window (in case of windowed mode)
+ if (!(SDL_GetAppState( ) & SDL_APPMOUSEFOCUS))
+ return;
+
if (_videoMode.aspectRatioCorrection && !_overlayVisible)
y1 = real2Aspect(y);