src/video/android/SDL_androidvideo.c
changeset 11865 af91d564aa40
parent 11811 5d94cb6b24d3
child 12012 6de756c9975a
     1.1 --- a/src/video/android/SDL_androidvideo.c	Sun Feb 11 17:25:51 2018 -0800
     1.2 +++ b/src/video/android/SDL_androidvideo.c	Sun Feb 11 18:23:37 2018 -0800
     1.3 @@ -120,6 +120,7 @@
     1.4  
     1.5      device->CreateSDLWindow = Android_CreateWindow;
     1.6      device->SetWindowTitle = Android_SetWindowTitle;
     1.7 +    device->SetWindowFullscreen = Android_SetWindowFullscreen;
     1.8      device->DestroyWindow = Android_DestroyWindow;
     1.9      device->GetWindowWMInfo = Android_GetWindowWMInfo;
    1.10  
    1.11 @@ -220,7 +221,7 @@
    1.12      /*
    1.13        Update the resolution of the desktop mode, so that the window
    1.14        can be properly resized. The screen resolution change can for
    1.15 -      example happen when the Activity enters or exists immersive mode,
    1.16 +      example happen when the Activity enters or exits immersive mode,
    1.17        which can happen after VideoInit().
    1.18      */
    1.19      device = SDL_GetVideoDevice();
    1.20 @@ -234,16 +235,17 @@
    1.21      }
    1.22  
    1.23      if (Android_Window) {
    1.24 -        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
    1.25 -
    1.26          /* Force the current mode to match the resize otherwise the SDL_WINDOWEVENT_RESTORED event
    1.27           * will fall back to the old mode */
    1.28          display = SDL_GetDisplayForWindow(Android_Window);
    1.29  
    1.30 -        display->current_mode.format = format;
    1.31 -        display->current_mode.w = width;
    1.32 -        display->current_mode.h = height;
    1.33 -        display->current_mode.refresh_rate = rate;
    1.34 +        display->display_modes[0].format = format;
    1.35 +        display->display_modes[0].w = width;
    1.36 +        display->display_modes[0].h = height;
    1.37 +        display->display_modes[0].refresh_rate = rate;
    1.38 +        display->current_mode = display->display_modes[0];
    1.39 +
    1.40 +        SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height);
    1.41      }
    1.42  }
    1.43