diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 31b0597c4..3606f3ccb 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1215,7 +1215,7 @@ static SDL_DisplayID GetDisplayForRect(int x, int y, int w, int h) /* Check if the window is fully enclosed */ if (SDL_GetRectEnclosingPoints(¢er, 1, &display_rect, NULL)) { - return i; + return display->id; } /* Snap window center to the display rect */