src/video/x11/SDL_x11modes.c
changeset 1318 f95502c6fc72
parent 1312 c9b51268668f
child 1336 3692456e7b0f
equal deleted inserted replaced
1317:6c7b69218276 1318:f95502c6fc72
   363         SDL_modelist = (SDL_Rect **)malloc((nmodes+2)*sizeof(SDL_Rect *));
   363         SDL_modelist = (SDL_Rect **)malloc((nmodes+2)*sizeof(SDL_Rect *));
   364         if ( SDL_modelist ) {
   364         if ( SDL_modelist ) {
   365             n = 0;
   365             n = 0;
   366             for ( i=0; i<nmodes; ++i ) {
   366             for ( i=0; i<nmodes; ++i ) {
   367                 int w, h;
   367                 int w, h;
       
   368 
       
   369 		/* Eliminate duplicate modes with different refresh rates */
       
   370 		if ( i > 0 &&
       
   371 		     modes[i]->hdisplay == modes[i-1]->hdisplay &&
       
   372 		     modes[i]->vdisplay == modes[i-1]->vdisplay ) {
       
   373 			continue;
       
   374 		}
   368 
   375 
   369                 /* Check to see if we should add the screen size (Xinerama) */
   376                 /* Check to see if we should add the screen size (Xinerama) */
   370                 w = modes[i]->hdisplay;
   377                 w = modes[i]->hdisplay;
   371                 h = modes[i]->vdisplay;
   378                 h = modes[i]->vdisplay;
   372                 if ( (screen_w * screen_h) >= (w * h) ) {
   379                 if ( (screen_w * screen_h) >= (w * h) ) {