diff src/video/x11/SDL_x11modes.c @ 1318:f95502c6fc72

Eliminate duplicate modes with different refresh rates
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Feb 2006 09:28:42 +0000
parents c9b51268668f
children 3692456e7b0f
line wrap: on
line diff
--- 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;