Index: binaries/data/config/default.cfg
===================================================================
--- binaries/data/config/default.cfg	(revision 18806)
+++ binaries/data/config/default.cfg	(working copy)
@@ -26,6 +26,12 @@
 ; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
 windowed = false
 
+; Use 'fake' fullscreen mode (SDL_WINDOW_FULLSCREEN_DESKTOP)
+; when creating the game window to work around some issues
+; with true fullscreen mode (SDL_WINDOW_FULLSCREEN).
+; See details in http://trac.wildfiregames.com/ticket/2845
+fakefullscreen = true
+
 ; Show detailed tooltips (Unit stats)
 showdetailedtooltips = false
 
Index: libraries/source/spidermonkey/lib/mozjs38-ps-debug.lib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: libraries/source/spidermonkey/lib/mozjs38-ps-release.lib
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: source/ps/GameSetup/GameSetup.cpp
===================================================================
--- source/ps/GameSetup/GameSetup.cpp	(revision 18806)
+++ source/ps/GameSetup/GameSetup.cpp	(working copy)
@@ -396,7 +396,7 @@
 		if (!reentering)
 		{
 			reentering = true;
-			g_VideoMode.SetFullscreen(false);
+			g_VideoMode.SetFullscreen(false, false);
 			reentering = false;
 		}
 	}
Index: source/ps/VideoMode.cpp
===================================================================
--- source/ps/VideoMode.cpp	(revision 18806)
+++ source/ps/VideoMode.cpp	(working copy)
@@ -49,7 +49,8 @@
 CVideoMode::CVideoMode() :
 	m_IsFullscreen(false), m_IsInitialised(false), m_Window(NULL),
 	m_PreferredW(0), m_PreferredH(0), m_PreferredBPP(0), m_PreferredFreq(0),
-	m_ConfigW(0), m_ConfigH(0), m_ConfigBPP(0), m_ConfigFullscreen(false), m_ConfigForceS3TCEnable(true),
+	m_ConfigW(0), m_ConfigH(0), m_ConfigBPP(0),
+	m_ConfigFullscreen(false), m_ConfigFakeFullscreen(true), m_ConfigForceS3TCEnable(true),
 	m_WindowedW(DEFAULT_WINDOW_W), m_WindowedH(DEFAULT_WINDOW_H), m_WindowedX(0), m_WindowedY(0)
 {
 	// (m_ConfigFullscreen defaults to false, so users don't get stuck if
@@ -62,6 +63,8 @@
 	CFG_GET_VAL("windowed", windowed);
 	m_ConfigFullscreen = !windowed;
 
+	CFG_GET_VAL("fakefullscreen", m_ConfigFakeFullscreen);
+
 	CFG_GET_VAL("xres", m_ConfigW);
 	CFG_GET_VAL("yres", m_ConfigH);
 	CFG_GET_VAL("bpp", m_ConfigBPP);
@@ -69,11 +72,11 @@
 	CFG_GET_VAL("force_s3tc_enable", m_ConfigForceS3TCEnable);
 }
 
-bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
+bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen, bool fakeFullscreen)
 {
 	Uint32 flags = 0;
 	if (fullscreen)
-		flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+		flags |= (fakeFullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_FULLSCREEN);
 
 	if (!m_Window)
 	{
@@ -92,7 +95,7 @@
 					w, h, bpp, SDL_GetError());
 				// Using default size for the window for now, as the attempted setting
 				// could be as large, or larger than the screen size.
-				return SetVideoMode(DEFAULT_WINDOW_W, DEFAULT_WINDOW_H, bpp, false);	
+				return SetVideoMode(DEFAULT_WINDOW_W, DEFAULT_WINDOW_H, bpp, false, false);
 			}
 			else
 			{
@@ -215,13 +218,13 @@
 	SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
 #endif
 
-	if (!SetVideoMode(w, h, bpp, m_ConfigFullscreen))
+	if (!SetVideoMode(w, h, bpp, m_ConfigFullscreen, m_ConfigFakeFullscreen))
 	{
 		// Fall back to a smaller depth buffer
 		// (The rendering may be ugly but this helps when running in VMware)
 		SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
 
-		if (!SetVideoMode(w, h, bpp, m_ConfigFullscreen))
+		if (!SetVideoMode(w, h, bpp, m_ConfigFullscreen, m_ConfigFakeFullscreen))
 			return false;
 	}
 
@@ -320,7 +323,7 @@
 
 	int bpp = GetBestBPP();
 
-	if (!SetVideoMode(w, h, bpp, false))
+	if (!SetVideoMode(w, h, bpp, false, false))
 		return false;
 
 	m_WindowedW = w;
@@ -331,7 +334,7 @@
 	return true;
 }
 
-bool CVideoMode::SetFullscreen(bool fullscreen)
+bool CVideoMode::SetFullscreen(bool fullscreen, bool fakeFullscreen)
 {
 	// This might get called before initialisation by psDisplayError;
 	// if so then silently fail
@@ -367,7 +370,7 @@
 
 		int bpp = GetBestBPP();
 
-		if (!SetVideoMode(w, h, bpp, fullscreen))
+		if (!SetVideoMode(w, h, bpp, fullscreen, fakeFullscreen))
 			return false;
 
 		UpdateRenderer(m_CurrentW, m_CurrentH);
@@ -383,7 +386,7 @@
 
 		int bpp = GetBestBPP();
 
-		if (!SetVideoMode(w, h, bpp, fullscreen))
+		if (!SetVideoMode(w, h, bpp, fullscreen, fakeFullscreen))
 			return false;
 
 		UpdateRenderer(w, h);
@@ -394,7 +397,7 @@
 
 bool CVideoMode::ToggleFullscreen()
 {
-	return SetFullscreen(!m_IsFullscreen);
+	return SetFullscreen(!m_IsFullscreen, m_ConfigFakeFullscreen);
 }
 
 void CVideoMode::UpdatePosition(int x, int y)
Index: source/ps/VideoMode.h
===================================================================
--- source/ps/VideoMode.h	(revision 18806)
+++ source/ps/VideoMode.h	(working copy)
@@ -50,7 +50,7 @@
 	/**
 	 * Switch to fullscreen or windowed mode.
 	 */
-	bool SetFullscreen(bool fullscreen);
+	bool SetFullscreen(bool fullscreen, bool fakeFullscreen);
 
 	/**
 	 * Switch between fullscreen and windowed mode.
@@ -83,7 +83,7 @@
 private:
 	void ReadConfig();
 	int GetBestBPP();
-	bool SetVideoMode(int w, int h, int bpp, bool fullscreen);
+	bool SetVideoMode(int w, int h, int bpp, bool fullscreen, bool fakeFullscreen);
 	void EnableS3TC();
 
 	/**
@@ -107,6 +107,7 @@
 	int m_ConfigBPP;
 	int m_ConfigDisplay;
 	bool m_ConfigFullscreen;
+	bool m_ConfigFakeFullscreen;
 	bool m_ConfigForceS3TCEnable;
 
 	// If we're fullscreen, size/position of window when we were last windowed (or the default window
