src/video/x11/SDL_x11modes.c
changeset 9167 3d2c0f659ad3
parent 8922 dfb6f8611ebe
equal deleted inserted replaced
9166:e5a2e31d4bee 9167:3d2c0f659ad3
   373 
   373 
   374 int
   374 int
   375 X11_InitModes(_THIS)
   375 X11_InitModes(_THIS)
   376 {
   376 {
   377     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
   377     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
   378     int screen, screencount;
   378     int snum, screen, screencount;
   379 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   379 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   380     int xinerama_major, xinerama_minor;
   380     int xinerama_major, xinerama_minor;
   381     int use_xinerama = 0;
   381     int use_xinerama = 0;
   382     XineramaScreenInfo *xinerama = NULL;
   382     XineramaScreenInfo *xinerama = NULL;
   383 #endif
   383 #endif
   421     if (CheckVidMode(data->display, &vm_major, &vm_minor)) {
   421     if (CheckVidMode(data->display, &vm_major, &vm_minor)) {
   422         use_vidmode = vm_major * 100 + vm_minor;
   422         use_vidmode = vm_major * 100 + vm_minor;
   423     }
   423     }
   424 #endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
   424 #endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
   425 
   425 
   426     for (screen = 0; screen < screencount; ++screen) {
   426     for (snum = 0; snum < screencount; ++snum) {
   427         XVisualInfo vinfo;
   427         XVisualInfo vinfo;
   428         SDL_VideoDisplay display;
   428         SDL_VideoDisplay display;
   429         SDL_DisplayData *displaydata;
   429         SDL_DisplayData *displaydata;
   430         SDL_DisplayMode mode;
   430         SDL_DisplayMode mode;
   431         SDL_DisplayModeData *modedata;
   431         SDL_DisplayModeData *modedata;
   432         XPixmapFormatValues *pixmapFormats;
   432         XPixmapFormatValues *pixmapFormats;
   433         char display_name[128];
   433         char display_name[128];
   434         int i, n;
   434         int i, n;
       
   435 
       
   436         /* Re-order screens to always put default screen first */
       
   437         if (snum == 0) {
       
   438             screen = DefaultScreen(data->display);
       
   439         } else if (snum == DefaultScreen(data->display)) {
       
   440             screen = 0;
       
   441         } else {
       
   442             screen = snum;
       
   443         }
   435 
   444 
   436 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   445 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   437         if (xinerama) {
   446         if (xinerama) {
   438             if (get_visualinfo(data->display, 0, &vinfo) < 0) {
   447             if (get_visualinfo(data->display, 0, &vinfo) < 0) {
   439                 continue;
   448                 continue;