From 276f664e505411a1341517a615a7b4c119ab6d7f Mon Sep 17 00:00:00 2001
From: Nimetu <nimetu@gmail.com>
Date: Fri, 27 Sep 2013 12:16:13 +0300
Subject: [PATCH 1/2] Fixed: restore correct fullscreen resolution

---
 code/ryzom/client/src/login.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp
index 506e283ca..45e3fea51 100644
--- a/code/ryzom/client/src/login.cpp
+++ b/code/ryzom/client/src/login.cpp
@@ -1943,16 +1943,21 @@ class CAHInitResLod : public IActionHandler
 
 		VideoModes.clear();
 		StringModeList.clear();
-		StringModeList.push_back("uiConfigWindowed");
 
 		CurrentMode = getRyzomModes(VideoModes, StringModeList);
 
+		// getRyzomModes() expects empty list, so we need to insert 'Windowed' after mode list is filled
+		StringModeList.insert(StringModeList.begin(), "uiConfigWindowed");
+
 		// If the client is in windowed mode, still in windowed mode and do not change anything
 		if (ClientCfg.Windowed)
 			CurrentMode = 0;
 		// If we have not found the mode so it can be an error or machine change, so propose the first available
 		else if (CurrentMode == -1)
 			CurrentMode = 1;
+		// We inserted 'Windowed' as first mode, so index needs to move too
+		else
+			++CurrentMode;
 
 		CInterfaceManager *pIM = CInterfaceManager::getInstance();
 		CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:login:checkpass:content:res_value"));

From 5da36a54e45d0dce53eca13c7137d1c04474b9e3 Mon Sep 17 00:00:00 2001
From: Nimetu <nimetu@gmail.com>
Date: Fri, 27 Sep 2013 12:58:34 +0300
Subject: [PATCH 2/2] Fixed: Do not save client.cfg when exiting from char
 selection screen or correct window size is lost

---
 code/ryzom/client/src/release.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp
index eea5c6ef9..dae95767c 100644
--- a/code/ryzom/client/src/release.cpp
+++ b/code/ryzom/client/src/release.cpp
@@ -468,8 +468,6 @@ void releaseOutGame()
 	// flush the server string cache
 	STRING_MANAGER::CStringManagerClient::instance()->flushStringCache();
 
-	ClientCfg.release ();
-
 	// Disconnect the client from the server.
 	NetMngr.disconnect();