comparison src/video/x11/SDL_x11modes.c @ 4207:a673f44949d6 SDL-1.2

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
author Sam Lantinga <slouken@libsdl.org>
date Mon, 21 Sep 2009 07:20:51 +0000
parents a1b03ba2fcd0
children 63fd67e17705
comparison
equal deleted inserted replaced
4206:892623cfee40 4207:a673f44949d6
524 524
525 #if SDL_VIDEO_DRIVER_X11_XINERAMA 525 #if SDL_VIDEO_DRIVER_X11_XINERAMA
526 /* Query Xinerama extention */ 526 /* Query Xinerama extention */
527 if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) { 527 if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) {
528 /* Find out which screen is the desired one */ 528 /* Find out which screen is the desired one */
529 int desired = 0; 529 int desired = -1;
530 int screens; 530 int screens;
531 int w, h; 531 int w, h;
532 SDL_NAME(XineramaScreenInfo) *xinerama; 532 SDL_NAME(XineramaScreenInfo) *xinerama;
533 533
534 const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD"); 534 const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
645 645
646 #if SDL_VIDEO_DRIVER_X11_VIDMODE 646 #if SDL_VIDEO_DRIVER_X11_VIDMODE
647 /* XVidMode */ 647 /* XVidMode */
648 if ( !use_xrandr && 648 if ( !use_xrandr &&
649 #if SDL_VIDEO_DRIVER_X11_XINERAMA 649 #if SDL_VIDEO_DRIVER_X11_XINERAMA
650 (!use_xinerama || xinerama_info.screen_number == 0) && 650 (!use_xinerama || xinerama_info.screen_number == -1) &&
651 #endif 651 #endif
652 CheckVidMode(this, &vm_major, &vm_minor) && 652 CheckVidMode(this, &vm_major, &vm_minor) &&
653 SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) ) 653 SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) )
654 { 654 {
655 #ifdef X11MODES_DEBUG 655 #ifdef X11MODES_DEBUG