From 29c30cb8f8b0e08f5fbe3a78d90dd082dedb6a12 Mon Sep 17 00:00:00 2001 From: Adrian Wielgosik Date: Sat, 28 Feb 2015 00:22:09 +0100 Subject: [PATCH] Don't scroll the window if it lost keyboard focus --- src/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/input.c b/src/input.c index a3d8884a7e..ce4bf1f6d2 100644 --- a/src/input.c +++ b/src/input.c @@ -1302,6 +1302,10 @@ void game_handle_edge_scroll() if (mainWindow->viewport == NULL) return; + uint32 window_flags = SDL_GetWindowFlags(gWindow); + if ((window_flags & SDL_WINDOW_INPUT_FOCUS) == 0) + return; + scrollX = 0; scrollY = 0;