Skip to content

Commit

Permalink
Always Use Next Display Index
Browse files Browse the repository at this point in the history
WIN_AddDisplay asserted that the returned index is the expected next
one in the list. This can be an unexpected number when displays are
add and removed in a batch (eg, Remote Desktop disconnect and reconnect).
Instead always just make use of the next index, even if it is not the
expected next index value. This fixes issue #9105
  • Loading branch information
jimtahu committed Nov 15, 2024
1 parent 11ffdd3 commit 7d5cfbc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/video/windows/SDL_windowsmodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,10 @@ static void WIN_AddDisplay(_THIS, HMONITOR hMonitor, const MONITORINFOEXW *info,
display.driverdata = displaydata;
WIN_GetDisplayBounds(_this, &display, &displaydata->bounds);
index = SDL_AddVideoDisplay(&display, send_event);
SDL_assert(index == *display_index);
SDL_free(display.name);

done:
*display_index += 1;
*display_index = index + 1;
}

typedef struct _WIN_AddDisplaysData
Expand Down

0 comments on commit 7d5cfbc

Please sign in to comment.