Remove full-desktop Xinerama mode when using XRandR
authorDavid Gow <david@ingeniumdigital.com>
Tue, 25 Jun 2013 21:36:36 +0800
changeset 73619b4430c49235
parent 7360 b86947ea2749
child 7362 fdf6c14b447c
Remove full-desktop Xinerama mode when using XRandR
src/video/x11/SDL_x11modes.c
     1.1 --- a/src/video/x11/SDL_x11modes.c	Sat Jul 06 12:28:57 2013 -0700
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Tue Jun 25 21:36:36 2013 +0800
     1.3 @@ -689,9 +689,11 @@
     1.4  
     1.5  #if SDL_VIDEO_DRIVER_X11_XINERAMA
     1.6      if (data->use_xinerama) {
     1.7 -        /* Add the full (both screens combined) xinerama mode only on the display that starts at 0,0 */
     1.8 -        if (!data->xinerama_info.x_org && !data->xinerama_info.y_org &&
     1.9 +        if (data->use_vidmode && !data->xinerama_info.x_org && !data->xinerama_info.y_org &&
    1.10             (screen_w > data->xinerama_info.width || screen_h > data->xinerama_info.height)) {
    1.11 +            /* Add the full (both screens combined) xinerama mode only on the display that starts at 0,0
    1.12 +             * if we're using vidmode.
    1.13 +             */
    1.14              mode.w = screen_w;
    1.15              mode.h = screen_h;
    1.16              mode.refresh_rate = 0;
    1.17 @@ -702,6 +704,20 @@
    1.18              mode.driverdata = modedata;
    1.19              SDL_AddDisplayMode(sdl_display, &mode);
    1.20          }
    1.21 +        else
    1.22 +        {
    1.23 +            /* Add the current mode of each monitor otherwise */
    1.24 +            mode.w = data->xinerama_info.width;
    1.25 +            mode.h = data->xinerama_info.height;
    1.26 +            mode.refresh_rate = 0;
    1.27 +            modedata = (SDL_DisplayModeData *) SDL_calloc(1, sizeof(SDL_DisplayModeData));
    1.28 +            if (modedata) {
    1.29 +                *modedata = *(SDL_DisplayModeData *)sdl_display->desktop_mode.driverdata;
    1.30 +            }
    1.31 +            mode.driverdata = modedata;
    1.32 +            SDL_AddDisplayMode(sdl_display, &mode);
    1.33 +        }
    1.34 +
    1.35      }
    1.36  #endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
    1.37