--- a/src/SDL_compat.c Thu Dec 03 08:33:39 2009 +0000
+++ b/src/SDL_compat.c Thu Dec 03 08:43:12 2009 +0000
@@ -64,12 +64,26 @@
return NULL;
}
+static void
+SelectVideoDisplay()
+{
+ const char *variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_DISPLAY");
+ if ( !variable ) {
+ variable = SDL_getenv("SDL_VIDEO_FULLSCREEN_HEAD");
+ }
+ if ( variable ) {
+ SDL_SelectVideoDisplay(SDL_atoi(variable));
+ }
+}
+
const SDL_VideoInfo *
SDL_GetVideoInfo(void)
{
static SDL_VideoInfo info;
SDL_DisplayMode mode;
+ SelectVideoDisplay();
+
/* Memory leak, compatibility code, who cares? */
if (!info.vfmt && SDL_GetDesktopDisplayMode(&mode) == 0) {
int bpp;
@@ -93,6 +107,8 @@
return 0;
}
+ SelectVideoDisplay();
+
if (!(flags & SDL_FULLSCREEN)) {
SDL_DisplayMode mode;
SDL_GetDesktopDisplayMode(&mode);
@@ -124,6 +140,8 @@
return NULL;
}
+ SelectVideoDisplay();
+
if (!(flags & SDL_FULLSCREEN)) {
return (SDL_Rect **) (-1);
}
@@ -495,6 +513,8 @@
}
}
+ SelectVideoDisplay();
+
SDL_GetDesktopDisplayMode(&desktop_mode);
if (width == 0) {