Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always Use Next Display Index #11474

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/video/windows/SDL_windowsmodes.c
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For additional context, the old removed display at index 0 has been marked invalid from the loop on 822, which is why the first existing display gets 1, and the defunct display isn't removed until the cleanup on line 833

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
Loading