瀏覽代碼

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.
Frank Praznik 3 年之前
父節點
當前提交
d58693928d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/video/SDL_video.c

+ 1 - 1
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 */
             /* Check if the window is fully enclosed */
             if (SDL_GetRectEnclosingPoints(&center, 1, &display_rect, NULL)) {
             if (SDL_GetRectEnclosingPoints(&center, 1, &display_rect, NULL)) {
-                return i;
+                return display->id;
             }
             }
 
 
             /* Snap window center to the display rect */
             /* Snap window center to the display rect */