Skip to content
Snippets Groups Projects
Unverified Commit caaf2368 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #8581 from devsnek/send-resume

implement resume message
parents 09300abe 742f6790
No related branches found
No related tags found
No related merge requests found
...@@ -636,6 +636,10 @@ void AppletMessageQueue::RequestExit() { ...@@ -636,6 +636,10 @@ void AppletMessageQueue::RequestExit() {
PushMessage(AppletMessage::Exit); PushMessage(AppletMessage::Exit);
} }
void AppletMessageQueue::RequestResume() {
PushMessage(AppletMessage::Resume);
}
void AppletMessageQueue::FocusStateChanged() { void AppletMessageQueue::FocusStateChanged() {
PushMessage(AppletMessage::FocusStateChanged); PushMessage(AppletMessage::FocusStateChanged);
} }
......
...@@ -90,6 +90,7 @@ public: ...@@ -90,6 +90,7 @@ public:
AppletMessage PopMessage(); AppletMessage PopMessage();
std::size_t GetMessageCount() const; std::size_t GetMessageCount() const;
void RequestExit(); void RequestExit();
void RequestResume();
void FocusStateChanged(); void FocusStateChanged();
void OperationModeChanged(); void OperationModeChanged();
......
...@@ -1131,6 +1131,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { ...@@ -1131,6 +1131,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) {
OnPauseGame(); OnPauseGame();
} else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) { } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) {
auto_paused = false; auto_paused = false;
RequestGameResume();
OnStartGame(); OnStartGame();
} }
} }
...@@ -2570,6 +2571,7 @@ void GMainWindow::OnPauseContinueGame() { ...@@ -2570,6 +2571,7 @@ void GMainWindow::OnPauseContinueGame() {
if (emu_thread->IsRunning()) { if (emu_thread->IsRunning()) {
OnPauseGame(); OnPauseGame();
} else { } else {
RequestGameResume();
OnStartGame(); OnStartGame();
} }
} }
...@@ -3749,6 +3751,21 @@ void GMainWindow::RequestGameExit() { ...@@ -3749,6 +3751,21 @@ void GMainWindow::RequestGameExit() {
} }
} }
void GMainWindow::RequestGameResume() {
auto& sm{system->ServiceManager()};
auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE");
auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE");
if (applet_oe != nullptr) {
applet_oe->GetMessageQueue()->RequestResume();
return;
}
if (applet_ae != nullptr) {
applet_ae->GetMessageQueue()->RequestResume();
}
}
void GMainWindow::filterBarSetChecked(bool state) { void GMainWindow::filterBarSetChecked(bool state) {
ui->action_Show_Filter_Bar->setChecked(state); ui->action_Show_Filter_Bar->setChecked(state);
emit(OnToggleFilterBar()); emit(OnToggleFilterBar());
......
...@@ -244,6 +244,7 @@ private: ...@@ -244,6 +244,7 @@ private:
bool ConfirmChangeGame(); bool ConfirmChangeGame();
bool ConfirmForceLockedExit(); bool ConfirmForceLockedExit();
void RequestGameExit(); void RequestGameExit();
void RequestGameResume();
void closeEvent(QCloseEvent* event) override; void closeEvent(QCloseEvent* event) override;
private slots: private slots:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment