# HG changeset patch # User Sam Lantinga # Date 1227643587 0 # Node ID 985001797115bdc6b9c32c9aa8f1a5e19fc031d0 # Parent 44be910366a903d5b54a20da4c29e7ee6b1a40cb Fixed bug #605, per Martin's suggestion diff -r 44be910366a9 -r 985001797115 src/video/SDL_video.c --- a/src/video/SDL_video.c Tue Nov 25 08:40:52 2008 +0000 +++ b/src/video/SDL_video.c Tue Nov 25 20:06:27 2008 +0000 @@ -488,11 +488,20 @@ for (i = 0; i < SDL_GetNumDisplayModes(); ++i) { current = &SDL_CurrentDisplay.display_modes[i]; - if ((current->w && current->h) && - (current->w < mode->w || current->h < mode->h)) { + if (current->w && (current->w < mode->w)) { /* Out of sorted modes large enough here */ break; } + if (current->h && (current->h < mode->h)) { + if (current->w && (current->w == mode->w)) { + /* Out of sorted modes large enough here */ + break; + } + /* Wider, but not tall enough, due to a different + aspect ratio. This mode must be skipped, but closer + modes may still follow. */ + continue; + } if (!match || current->w < match->w || current->h < match->h) { match = current; continue;