Eliminate duplicate modes with different refresh rates
authorSam Lantinga <slouken@libsdl.org>
Wed, 01 Feb 2006 09:28:42 +0000
changeset 1318 f95502c6fc72
parent 1317 6c7b69218276
child 1319 66f6c64c2c69
Eliminate duplicate modes with different refresh rates
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Wed Feb 01 09:01:12 2006 +0000
+++ b/src/video/x11/SDL_x11modes.c	Wed Feb 01 09:28:42 2006 +0000
@@ -366,6 +366,13 @@
             for ( i=0; i<nmodes; ++i ) {
                 int w, h;
 
+		/* Eliminate duplicate modes with different refresh rates */
+		if ( i > 0 &&
+		     modes[i]->hdisplay == modes[i-1]->hdisplay &&
+		     modes[i]->vdisplay == modes[i-1]->vdisplay ) {
+			continue;
+		}
+
                 /* Check to see if we should add the screen size (Xinerama) */
                 w = modes[i]->hdisplay;
                 h = modes[i]->vdisplay;