From d8683dd99fae812ba7c9a4c8b24d49c8ecf4a1bc Mon Sep 17 00:00:00 2001 From: thexai <58434170+thexai@users.noreply.github.com> Date: Sat, 25 Jan 2020 18:21:39 +0100 Subject: [PATCH] Removed Advancedsettings 'AutoHDR' and now is used GUI Settings -> Player -> Use HDR display capabilities instead --- xbmc/Application.cpp | 16 ---------------- xbmc/rendering/dx/DeviceResources.cpp | 17 +++++++++++++++++ xbmc/settings/AdvancedSettings.cpp | 4 ---- xbmc/settings/AdvancedSettings.h | 2 -- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 4188794e2c8ab..67ada88c984de 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -562,13 +562,6 @@ bool CApplication::Create(const CAppParamParser ¶ms) //! @todo - move to CPlatformXXX #ifdef TARGET_WINDOWS CWIN32Util::SetThreadLocalLocale(true); // enable independent locale for each thread, see https://connect.microsoft.com/VisualStudio/feedback/details/794122 - if (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_bAutoHDR && - CWIN32Util::GetWindowsHDRStatus() == 1) - { - CLog::Log(LOGNOTICE, "Turning display HDR on due advancedsettings"); - CWIN32Util::ToggleWindowsHDR(); - Sleep(2000); - } #endif // TARGET_WINDOWS // application inbound service @@ -2643,15 +2636,6 @@ void CApplication::Stop(int exitCode) cleanup_emu_environ(); -#if defined(TARGET_WINDOWS) - if (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_bAutoHDR && - exitCode == EXITCODE_QUIT && CWIN32Util::GetWindowsHDRStatus() == 2) - { - CWIN32Util::ToggleWindowsHDR(); - Sleep(1800); - } -#endif - Sleep(200); } diff --git a/xbmc/rendering/dx/DeviceResources.cpp b/xbmc/rendering/dx/DeviceResources.cpp index 5cb830450c839..96da985099978 100644 --- a/xbmc/rendering/dx/DeviceResources.cpp +++ b/xbmc/rendering/dx/DeviceResources.cpp @@ -14,8 +14,10 @@ #include "windowing/GraphicContext.h" #include "messaging/ApplicationMessenger.h" #include "platform/win32/CharsetConverter.h" +#include "platform/win32/WIN32Util.h" #include "ServiceBroker.h" #include "settings/AdvancedSettings.h" +#include "settings/Settings.h" #include "settings/SettingsComponent.h" #include "utils/log.h" #include "utils/SystemInfo.h" @@ -286,6 +288,21 @@ bool DX::DeviceResources::SetFullScreen(bool fullscreen, RESOLUTION_INFO& res) // Configures resources that don't depend on the Direct3D device. void DX::DeviceResources::CreateDeviceIndependentResources() { + // Configures Windows HDR according GUI Settings / Player / Use HDR display capabilities + if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool( + Windowing()->SETTING_WINSYSTEM_IS_HDR_DISPLAY) && + CWIN32Util::GetWindowsHDRStatus() == 1) + { + CWIN32Util::ToggleWindowsHDR(); // Toggle Windows HDR on + Sleep(2000); + } + else if (!CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool( + Windowing()->SETTING_WINSYSTEM_IS_HDR_DISPLAY) && + CWIN32Util::GetWindowsHDRStatus() == 2) + { + CWIN32Util::ToggleWindowsHDR(); // Toggle Windows HDR off + Sleep(2000); + } } // Configures the Direct3D device, and stores handles to it and the device context. diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index 47f6eedb624c6..b5858fe54059a 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -363,8 +363,6 @@ void CAdvancedSettings::Initialize() m_bVirtualShares = true; m_bTry10bitOutput = false; - m_bAutoHDR = false; - m_cpuTempCmd = ""; m_gpuTempCmd = ""; #if defined(TARGET_DARWIN) @@ -897,8 +895,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) XMLUtils::GetUInt(pRootElement, "packagefoldersize", m_addonPackageFolderSize); XMLUtils::GetBoolean(pRootElement, "try10bitoutput", m_bTry10bitOutput); - XMLUtils::GetBoolean(pRootElement, "autoHDR", m_bAutoHDR); - // EPG pElement = pRootElement->FirstChildElement("epg"); if (pElement) diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 25bd81f7a09d5..d9e0775faa73e 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -305,8 +305,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler bool m_bVirtualShares; bool m_bTry10bitOutput; - bool m_bAutoHDR; - std::string m_cpuTempCmd; std::string m_gpuTempCmd;