diff --git a/Client/core/CSettings.cpp b/Client/core/CSettings.cpp index 1329928bda..6bd1dcae0d 100644 --- a/Client/core/CSettings.cpp +++ b/Client/core/CSettings.cpp @@ -920,9 +920,10 @@ void CSettings::CreateGUI() m_pCheckBoxBrowserGPUEnabled = reinterpret_cast(pManager->CreateCheckBox(m_pTabBrowser, _("Enable GPU rendering"), true)); m_pCheckBoxBrowserGPUEnabled->SetPosition(CVector2D(vecTemp.fX + 300.0f, vecTemp.fY - 20.0f)); m_pCheckBoxBrowserGPUEnabled->AutoSize(NULL, 20.0f); + m_pCheckBoxBrowserGPUEnabled->SetClickHandler(GUI_CALLBACK(&CSettings::OnGPUSettingChanged, this)); m_pCheckBoxBrowserGPUCompositingEnabled = - reinterpret_cast(pManager->CreateCheckBox(m_pTabBrowser, _("Enable GPU compositing (GPU required)"), true)); + reinterpret_cast(pManager->CreateCheckBox(m_pTabBrowser, _("Enable GPU compositing"), true)); m_pCheckBoxBrowserGPUCompositingEnabled->SetPosition(CVector2D(vecTemp.fX + 300.0f, vecTemp.fY)); m_pCheckBoxBrowserGPUCompositingEnabled->AutoSize(NULL, 20.0f); @@ -3298,6 +3299,10 @@ void CSettings::LoadData() m_pCheckBoxRemoteJavascript->SetSelected(bVar); CVARS_GET("browser_enable_gpu", bVar); m_pCheckBoxBrowserGPUEnabled->SetSelected(bVar); + + if (!bVar) + m_pCheckBoxBrowserGPUCompositingEnabled->SetEnabled(false); + CVARS_GET("browser_enable_gpu_compositing", bVar); m_pCheckBoxBrowserGPUCompositingEnabled->SetSelected(bVar); @@ -4901,3 +4906,9 @@ bool CSettings::IsActive() { return m_pWindow->IsActive(); } + +bool CSettings::OnGPUSettingChanged(CGUIElement* pElement) +{ + m_pCheckBoxBrowserGPUCompositingEnabled->SetEnabled(m_pCheckBoxBrowserGPUEnabled->GetSelected()); + return true; +} diff --git a/Client/core/CSettings.h b/Client/core/CSettings.h index fffe420d77..014590b80c 100644 --- a/Client/core/CSettings.h +++ b/Client/core/CSettings.h @@ -384,6 +384,7 @@ class CSettings bool OnBrowserWhitelistRemove(CGUIElement* pElement); bool OnBrowserWhitelistDomainAddFocused(CGUIElement* pElement); bool OnBrowserWhitelistDomainAddDefocused(CGUIElement* pElement); + bool OnGPUSettingChanged(CGUIElement* pElement); bool OnMouseDoubleClick(CGUIMouseEventArgs Args);