src/video/x11/SDL_x11modes.c
changeset 6502 f41a82de351e
parent 6482 94e3643928ed
child 6506 305f0fcc0e99
equal deleted inserted replaced
6501:2efafb933bd5 6502:f41a82de351e
   635     }
   635     }
   636 #endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
   636 #endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
   637 
   637 
   638 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   638 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   639     if (data->use_xinerama) {
   639     if (data->use_xinerama) {
       
   640         int screencount;
       
   641         XineramaScreenInfo *xinerama;
       
   642 
       
   643         /* Update the current screen layout information */
       
   644         xinerama = XineramaQueryScreens(display, &screencount);
       
   645         if (xinerama && data->screen < screencount) {
       
   646             data->xinerama_info = xinerama[data->screen];
       
   647         }
       
   648         if (xinerama) XFree(xinerama);
       
   649 
   640         *w = data->xinerama_info.width;
   650         *w = data->xinerama_info.width;
   641         *h = data->xinerama_info.height;
   651         *h = data->xinerama_info.height;
   642         *rate = 0;
   652         *rate = 0;
   643         return;
   653         return;
   644     }
   654     }
   787 }
   797 }
   788 
   798 
   789 int
   799 int
   790 X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect)
   800 X11_GetDisplayBounds(_THIS, SDL_VideoDisplay * sdl_display, SDL_Rect * rect)
   791 {
   801 {
       
   802     Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   792     SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata;
   803     SDL_DisplayData *data = (SDL_DisplayData *) sdl_display->driverdata;
   793 
   804     int real_rate;
   794 #if SDL_VIDEO_DRIVER_X11_XINERAMA
   805 
   795     if (data && data->use_xinerama) {
   806     rect->x = 0;
       
   807     rect->y = 0;
       
   808     get_real_resolution(display, data, &rect->w, &rect->h, &real_rate);
       
   809 
       
   810 #if SDL_VIDEO_DRIVER_X11_XINERAMA
       
   811     if (data->use_xinerama) {
   796         rect->x = data->xinerama_info.x_org;
   812         rect->x = data->xinerama_info.x_org;
   797         rect->y = data->xinerama_info.y_org;
   813         rect->y = data->xinerama_info.y_org;
   798         rect->w = data->xinerama_info.width;
   814     }
   799         rect->h = data->xinerama_info.height;
   815 #endif
   800         return 0;
       
   801     }
       
   802 #endif
       
   803     rect->x = 0;
       
   804     rect->y = 0;
       
   805     rect->w = sdl_display->current_mode.w;
       
   806     rect->h = sdl_display->current_mode.h;
       
   807     return 0;
   816     return 0;
   808 }
   817 }
   809 
   818 
   810 #endif /* SDL_VIDEO_DRIVER_X11 */
   819 #endif /* SDL_VIDEO_DRIVER_X11 */
   811 
   820