src/video/SDL_video.c
changeset 9818 cfeb59daba69
parent 9813 0652406e46c6
child 9887 77f017f7f16d
     1.1 --- a/src/video/SDL_video.c	Wed Jul 29 17:19:09 2015 -0700
     1.2 +++ b/src/video/SDL_video.c	Wed Jul 29 17:19:11 2015 -0700
     1.3 @@ -1679,12 +1679,31 @@
     1.4  
     1.5      /* Fullscreen windows are always at their display's origin */
     1.6      if (window->flags & SDL_WINDOW_FULLSCREEN) {
     1.7 +        int displayIndex;
     1.8 +        
     1.9          if (x) {
    1.10              *x = 0;
    1.11          }
    1.12          if (y) {
    1.13              *y = 0;
    1.14          }
    1.15 +
    1.16 +        /* Find the window's monitor and update to the
    1.17 +           monitor offset. */
    1.18 +        displayIndex = SDL_GetWindowDisplayIndex(window);
    1.19 +        if (displayIndex >= 0) {
    1.20 +            SDL_Rect bounds;
    1.21 +
    1.22 +            SDL_zero(bounds);
    1.23 +
    1.24 +            SDL_GetDisplayBounds(displayIndex, &bounds);
    1.25 +            if (x) {
    1.26 +                *x = bounds.x;
    1.27 +            }
    1.28 +            if (y) {
    1.29 +                *y = bounds.y;
    1.30 +            }
    1.31 +        }
    1.32      } else {
    1.33          if (x) {
    1.34              *x = window->x;