summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_general.cpp42
-rw-r--r--src/yuzu/configuration/configure_general.h2
2 files changed, 23 insertions, 21 deletions
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp
index 201d7a4c5..b322258a0 100644
--- a/src/yuzu/configuration/configure_general.cpp
+++ b/src/yuzu/configuration/configure_general.cpp
@@ -41,25 +41,27 @@ void ConfigureGeneral::PopulateHotkeyList(const HotkeyRegistry& registry) {
41 ui->widget->Populate(registry); 41 ui->widget->Populate(registry);
42} 42}
43 43
44void ConfigureGeneral::CheckIfOperationChanged(bool last_state, bool new_state) { 44void ConfigureGeneral::OnDockedModeChanged(bool last_state, bool new_state) {
45 if (last_state != new_state) { 45 if (last_state == new_state) {
46 Core::System& system{Core::System::GetInstance()}; 46 return;
47 Service::SM::ServiceManager& sm = system.ServiceManager(); 47 }
48 48
49 // Message queue is shared between these services, we just need to signal an operation 49 Core::System& system{Core::System::GetInstance()};
50 // change to one and it will handle both automatically 50 Service::SM::ServiceManager& sm = system.ServiceManager();
51 auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE"); 51
52 auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE"); 52 // Message queue is shared between these services, we just need to signal an operation
53 bool has_signalled = false; 53 // change to one and it will handle both automatically
54 54 auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
55 if (applet_oe != nullptr) { 55 auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");
56 applet_oe->GetMessageQueue()->OperationModeChanged(); 56 bool has_signalled = false;
57 has_signalled = true; 57
58 } 58 if (applet_oe != nullptr) {
59 59 applet_oe->GetMessageQueue()->OperationModeChanged();
60 if (applet_ae != nullptr && !has_signalled) { 60 has_signalled = true;
61 applet_ae->GetMessageQueue()->OperationModeChanged(); 61 }
62 } 62
63 if (applet_ae != nullptr && !has_signalled) {
64 applet_ae->GetMessageQueue()->OperationModeChanged();
63 } 65 }
64} 66}
65 67
@@ -72,7 +74,7 @@ void ConfigureGeneral::applyConfiguration() {
72 Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked(); 74 Settings::values.use_cpu_jit = ui->use_cpu_jit->isChecked();
73 const bool pre_docked_mode = Settings::values.use_docked_mode; 75 const bool pre_docked_mode = Settings::values.use_docked_mode;
74 Settings::values.use_docked_mode = ui->use_docked_mode->isChecked(); 76 Settings::values.use_docked_mode = ui->use_docked_mode->isChecked();
75 CheckIfOperationChanged(pre_docked_mode, Settings::values.use_docked_mode); 77 OnDockedModeChanged(pre_docked_mode, Settings::values.use_docked_mode);
76 78
77 Settings::values.enable_nfc = ui->enable_nfc->isChecked(); 79 Settings::values.enable_nfc = ui->enable_nfc->isChecked();
78} 80}
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h
index e4ce3c04c..2210d48da 100644
--- a/src/yuzu/configuration/configure_general.h
+++ b/src/yuzu/configuration/configure_general.h
@@ -25,7 +25,7 @@ public:
25 25
26private: 26private:
27 void setConfiguration(); 27 void setConfiguration();
28 void CheckIfOperationChanged(bool last_state, bool new_state); 28 void OnDockedModeChanged(bool last_state, bool new_state);
29 29
30 std::unique_ptr<Ui::ConfigureGeneral> ui; 30 std::unique_ptr<Ui::ConfigureGeneral> ui;
31}; 31};