From 5064f0417ba6586a874f2d7780e45f4cab8d8093 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 14 Oct 2021 15:16:46 +0300 Subject: [PATCH] Fix UI restore when window is resized while in loading screen --- ryzom/client/src/connection.cpp | 12 ------------ ryzom/client/src/interface_v3/interface_manager.cpp | 9 ++++++--- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ryzom/client/src/connection.cpp b/ryzom/client/src/connection.cpp index d7eaa2969..ce887e48e 100644 --- a/ryzom/client/src/connection.cpp +++ b/ryzom/client/src/connection.cpp @@ -1290,19 +1290,7 @@ TInterfaceState globalMenu() // Restore video mode if (ClientCfg.SelectCharacter == -1) - { - if (ClientCfg.Windowed) - { - // if used changed window resolution in char select - // if we don't update ClientCfg, then UI from icfg is restored wrong - uint32 width, height; - Driver->getWindowSize(width, height); - ClientCfg.Width = width; - ClientCfg.Height = height; - } - connectionRestoreVideoMode (); - } // Skip intro next time ClientCfg.writeBool("SkipIntro", true); diff --git a/ryzom/client/src/interface_v3/interface_manager.cpp b/ryzom/client/src/interface_v3/interface_manager.cpp index ab015e0d6..04b94faaf 100644 --- a/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/ryzom/client/src/interface_v3/interface_manager.cpp @@ -1899,9 +1899,12 @@ bool CInterfaceManager::loadConfig (const string &filename) // NB: we are typically InGame here (even though the _InGame flag is not yet set) // Use the screen size of the config file. Don't update current UI, just _Modes // - // ClientCfg has W/H set to screen size, but interface expects scaled size - sint32 scaledW = ClientCfg.Width / ClientCfg.InterfaceScale; - sint32 scaledH = ClientCfg.Height / ClientCfg.InterfaceScale; + uint32 width, height; + // get non-scaled width/height + Driver->getWindowSize(width, height); + // convert to scaled width/height for ui + sint32 scaledW = width / ClientCfg.InterfaceScale; + sint32 scaledH = height / ClientCfg.InterfaceScale; CWidgetManager::getInstance()->moveAllWindowsToNewScreenSize(scaledW, scaledH, false); updateDesktops(scaledW, scaledH); } -- 2.11.4.GIT