video: Only ignore modes with a lower color depth in SDL_GetClosestFullscreenDisplayMode()

If a mode with a closer refresh was found, but it had the same color depth as the current best match, it was being dropped. Only ignore the new mode if the color depth is below the current best match.

(cherry picked from commit cd0b796a6e)
This commit is contained in:
Frank Praznik 2026-05-25 11:25:02 -04:00
parent 33ea9c3e63
commit 483d86588c
No known key found for this signature in database

View file

@ -1426,7 +1426,7 @@ bool SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h,
* refresh rate target */
continue;
}
if (SDL_BYTESPERPIXEL(closest->format) >= SDL_BYTESPERPIXEL(mode->format)) {
if (SDL_BYTESPERPIXEL(closest->format) > SDL_BYTESPERPIXEL(mode->format)) {
// Prefer the highest color depth
continue;
}