From f743b63e02d20bddf7f541fb21c3d126249efb45 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Sep 2009 07:20:51 +0000 Subject: [PATCH] Fixed bug #562 this patch by Diego Petten?? 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 299a33755..715c1d15d 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -526,7 +526,7 @@ int X11_GetVideoModes(_THIS) /* Query Xinerama extention */ if ( CheckXinerama(this, &xinerama_major, &xinerama_minor) ) { /* Find out which screen is the desired one */ - int desired = 0; + int desired = -1; int screens; int w, h; SDL_NAME(XineramaScreenInfo) *xinerama; @@ -647,7 +647,7 @@ int X11_GetVideoModes(_THIS) /* XVidMode */ if ( !use_xrandr && #if SDL_VIDEO_DRIVER_X11_XINERAMA - (!use_xinerama || xinerama_info.screen_number == 0) && + (!use_xinerama || xinerama_info.screen_number == -1) && #endif CheckVidMode(this, &vm_major, &vm_minor) && SDL_NAME(XF86VidModeGetAllModeLines)(SDL_Display, SDL_Screen,&nmodes,&modes) )