From d58693928db28c2e3519a4891c694319941de76b Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Tue, 31 Jan 2023 12:34:38 -0500 Subject: [PATCH] video: Return the display ID when the window is fully enclosed If the window was fully enclosed, GetDisplayForRect() would return the index of the display ID in the array instead of the display ID itself. Return the display ID itself. --- src/video/SDL_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */