From b7b6b5162cc96f0ef1a120af817ce3dbf98ebdfa Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 8 May 2018 17:00:43 +0200 Subject: [PATCH 1/4] Qt/GeneralWidget: Refresh backend settings properly --- Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp index e78985321c..f2d970cebc 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp @@ -201,7 +201,11 @@ void GeneralWidget::SaveSettings() } } SConfig::GetInstance().m_strVideoBackend = current_backend; - backend->InitBackendInfo(); + + g_Config.Refresh(); + + g_video_backend = backend.get(); + g_video_backend->InitBackendInfo(); emit BackendChanged(QString::fromStdString(current_backend)); break; } From 6a34f2b47c4c06b4d1c3d0fcdfb773251cd2ae16 Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 8 May 2018 17:16:40 +0200 Subject: [PATCH 2/4] Qt/GeneralWidget: Fix "No" response to backend switch confirmation --- Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp index f2d970cebc..6053420ed9 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp @@ -173,8 +173,6 @@ void GeneralWidget::SaveSettings() const auto current_backend = backend->GetName(); if (SConfig::GetInstance().m_strVideoBackend != current_backend) { - SConfig::GetInstance().m_strVideoBackend = current_backend; - if (backend->GetName() == "Software Renderer") { QMessageBox confirm_sw; From 074a17482b3f99dcc51bccb224f0f78862a52d24 Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 8 May 2018 17:20:08 +0200 Subject: [PATCH 3/4] Qt/GraphicsWindow: Refresh settings on construction --- Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp index 5747535648..15615dfed2 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp @@ -19,10 +19,13 @@ #include "DolphinQt2/Config/Graphics/SoftwareRendererWidget.h" #include "DolphinQt2/MainWindow.h" #include "DolphinQt2/QtUtils/WrapInScrollArea.h" +#include "VideoCommon/VideoConfig.h" GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent) : QDialog(parent), m_xrr_config(xrr_config) { + g_Config.Refresh(); + CreateMainLayout(); setWindowTitle(tr("Graphics")); From be007b436c210a164ca7710761d35e88357fdfff Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 8 May 2018 17:39:03 +0200 Subject: [PATCH 4/4] Qt/GraphicsWindow: Fix software renderer breaking layout --- .../Config/Graphics/GraphicsWindow.cpp | 28 +++++++++++-------- .../Config/Graphics/GraphicsWindow.h | 6 ++++ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp index 15615dfed2..8cbe383e18 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.cpp @@ -70,18 +70,22 @@ void GraphicsWindow::CreateMainLayout() connect(m_software_renderer, &SoftwareRendererWidget::BackendChanged, this, &GraphicsWindow::OnBackendChanged); + m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 305); + m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 305); + m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 305); + m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 305); + m_wrapped_software = GetWrappedWidget(m_software_renderer, this, 50, 305); + if (SConfig::GetInstance().m_strVideoBackend != "Software Renderer") { - m_tab_widget->addTab(GetWrappedWidget(m_general_widget, this, 50, 305), tr("General")); - m_tab_widget->addTab(GetWrappedWidget(m_enhancements_widget, this, 50, 305), - tr("Enhancements")); - m_tab_widget->addTab(GetWrappedWidget(m_hacks_widget, this, 50, 305), tr("Hacks")); - m_tab_widget->addTab(GetWrappedWidget(m_advanced_widget, this, 50, 305), tr("Advanced")); + m_tab_widget->addTab(m_wrapped_general, tr("General")); + m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements")); + m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks")); + m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced")); } else { - m_tab_widget->addTab(GetWrappedWidget(m_software_renderer, this, 50, 305), - tr("Software Renderer")); + m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer")); } setLayout(main_layout); @@ -93,16 +97,16 @@ void GraphicsWindow::OnBackendChanged(const QString& backend) if (backend == QStringLiteral("Software Renderer") && m_tab_widget->count() > 1) { m_tab_widget->clear(); - m_tab_widget->addTab(m_software_renderer, tr("Software Renderer")); + m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer")); } if (backend != QStringLiteral("Software Renderer") && m_tab_widget->count() == 1) { m_tab_widget->clear(); - m_tab_widget->addTab(m_general_widget, tr("General")); - m_tab_widget->addTab(m_enhancements_widget, tr("Enhancements")); - m_tab_widget->addTab(m_hacks_widget, tr("Hacks")); - m_tab_widget->addTab(m_advanced_widget, tr("Advanced")); + m_tab_widget->addTab(m_wrapped_general, tr("General")); + m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements")); + m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks")); + m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced")); } emit BackendChanged(backend); diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h index e0c812bd71..1850180dcd 100644 --- a/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h +++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsWindow.h @@ -49,6 +49,12 @@ private: GeneralWidget* m_general_widget; SoftwareRendererWidget* m_software_renderer; + QWidget* m_wrapped_advanced; + QWidget* m_wrapped_enhancements; + QWidget* m_wrapped_hacks; + QWidget* m_wrapped_general; + QWidget* m_wrapped_software; + X11Utils::XRRConfiguration* m_xrr_config; QHash m_widget_descriptions;