src/video/android/SDL_androidvideo.c
changeset 12693 d311fcb8066a
parent 12625 e58468e48179
child 12823 f7629f5761d8
     1.1 --- a/src/video/android/SDL_androidvideo.c	Fri Apr 05 08:36:31 2019 +0200
     1.2 +++ b/src/video/android/SDL_androidvideo.c	Fri Apr 05 09:16:30 2019 +0200
     1.3 @@ -26,6 +26,7 @@
     1.4  
     1.5  #include "SDL_video.h"
     1.6  #include "SDL_mouse.h"
     1.7 +#include "SDL_hints.h"
     1.8  #include "../SDL_sysvideo.h"
     1.9  #include "../SDL_pixels_c.h"
    1.10  #include "../../events/SDL_events_c.h"
    1.11 @@ -93,6 +94,7 @@
    1.12  {
    1.13      SDL_VideoDevice *device;
    1.14      SDL_VideoData *data;
    1.15 +    SDL_bool block_on_pause;
    1.16  
    1.17      /* Initialize all variables that we clean on shutdown */
    1.18      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    1.19 @@ -113,7 +115,12 @@
    1.20      /* Set the function pointers */
    1.21      device->VideoInit = Android_VideoInit;
    1.22      device->VideoQuit = Android_VideoQuit;
    1.23 -    device->PumpEvents = Android_PumpEvents;
    1.24 +    block_on_pause = SDL_GetHintBoolean(SDL_HINT_ANDROID_BLOCK_ON_PAUSE, SDL_TRUE);
    1.25 +    if (block_on_pause) {
    1.26 +        device->PumpEvents = Android_PumpEvents_Blocking;
    1.27 +    } else {
    1.28 +        device->PumpEvents = Android_PumpEvents_NonBlocking;
    1.29 +    }
    1.30  
    1.31      device->GetDisplayDPI = Android_GetDisplayDPI;
    1.32