Fixed bug #562 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Mon, 21 Sep 2009 07:20:51 +0000
branchSDL-1.2
changeset 4207a673f44949d6
parent 4206 892623cfee40
child 4208 453587d6dc87
Fixed bug #562

this patch by Diego Pettenò <flameeyes@gentoo.org> for SDL-1.2:

The attached patch applies over latest ~arch SDL version, and allows to use the
xinerama support to launch an application full screened on the head "0".

The SDL_VIDEO_FULLSCREEN_HEAD environment variable sets the head on which the
full screen will be displayed, but if you set it to 0, the code simply ignores
it as unset. My patch changes the unset value to -1, so that the 0 value can be
used correctly. Without this, trying to get fullscreen on head 0 would get the
same result than not having xinerama enabled at all.

http://sources.gentoo.org/media-libs/libsdl/files/libsdl-1.2.11-xinerama-head-0.patch

SDL-1.3 doesnt seem to have any code like this, but it's still good for SDL-1.2
src/video/x11/SDL_x11modes.c
     1.1 --- a/src/video/x11/SDL_x11modes.c	Mon Sep 21 07:03:29 2009 +0000
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Mon Sep 21 07:20:51 2009 +0000
     1.3 @@ -526,7 +526,7 @@
     1.4      /* Query Xinerama extention */
     1.5      if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) {
     1.6          /* Find out which screen is the desired one */
     1.7 -        int desired = 0;
     1.8 +        int desired = -1;
     1.9          int screens;
    1.10          int w, h;
    1.11          SDL_NAME(XineramaScreenInfo) *xinerama;
    1.12 @@ -647,7 +647,7 @@
    1.13      /* XVidMode */
    1.14      if ( !use_xrandr &&
    1.15  #if SDL_VIDEO_DRIVER_X11_XINERAMA
    1.16 -         (!use_xinerama || xinerama_info.screen_number == 0) &&
    1.17 +         (!use_xinerama || xinerama_info.screen_number == -1) &&
    1.18  #endif
    1.19           CheckVidMode(this, &vm_major, &vm_minor) &&
    1.20           SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) )