src/video/SDL_video.c
changeset 6547 38bc368a3b87
parent 6522 edacce9402fb
child 6554 5bcda034e678
equal deleted inserted replaced
6544:c03db4864789 6547:38bc368a3b87
   931         }
   931         }
   932         return displayIndex;
   932         return displayIndex;
   933     }
   933     }
   934 
   934 
   935     /* Find the display containing the window */
   935     /* Find the display containing the window */
       
   936     for (i = 0; i < _this->num_displays; ++i) {
       
   937         SDL_VideoDisplay *display = &_this->displays[i];
       
   938 
       
   939         if (display->fullscreen_window == window) {
       
   940             return i;
       
   941         }
       
   942     }
   936     center.x = window->x + window->w / 2;
   943     center.x = window->x + window->w / 2;
   937     center.y = window->y + window->h / 2;
   944     center.y = window->y + window->h / 2;
   938     for (i = 0; i < _this->num_displays; ++i) {
   945     for (i = 0; i < _this->num_displays; ++i) {
   939         SDL_VideoDisplay *display = &_this->displays[i];
   946         SDL_VideoDisplay *display = &_this->displays[i];
   940 
   947 
   941         SDL_GetDisplayBounds(i, &rect);
   948         SDL_GetDisplayBounds(i, &rect);
   942         if (display->fullscreen_window == window || SDL_EnclosePoints(&center, 1, &rect, NULL)) {
   949         if (SDL_EnclosePoints(&center, 1, &rect, NULL)) {
   943             return i;
   950             return i;
   944         }
   951         }
   945 
   952 
   946         delta.x = center.x - (rect.x + rect.w / 2);
   953         delta.x = center.x - (rect.x + rect.w / 2);
   947         delta.y = center.y - (rect.y + rect.h / 2);
   954         delta.y = center.y - (rect.y + rect.h / 2);