fix: retrack application when guest applet is closed

This commit is contained in:
Exverge 2024-03-24 19:51:18 -04:00
parent 201bff1731
commit 41ebc0b06a
No known key found for this signature in database
GPG key ID: 19AAFC0AC6A9B35A
3 changed files with 14 additions and 0 deletions

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/settings.h"
@ -335,4 +336,8 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
applet->process->Run();
}
void AppletManager::ReTrackApplication(std::shared_ptr<Applet> applet) {
m_window_system->RequestApplicationToGetForeground();
}
} // namespace Service::AM

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@ -46,6 +47,7 @@ public:
public:
void SetWindowSystem(WindowSystem* window_system);
void ReTrackApplication(std::shared_ptr<Applet> applet);
private:
Core::System& m_system;

View file

@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/am/applet_data_broker.h"
@ -101,6 +102,12 @@ Result ILibraryAppletAccessor::PushInData(SharedPointer<IStorage> storage) {
Result ILibraryAppletAccessor::PopOutData(Out<SharedPointer<IStorage>> out_storage) {
LOG_DEBUG(Service_AM, "called");
if(!m_applet->caller_applet.expired()) {
LOG_DEBUG(Service_AM, "resuming caller");
system.GetAppletManager().ReTrackApplication(m_applet->caller_applet.lock());
} else {
LOG_CRITICAL(Service_AM, "Failed to track application. The emulator will freeze!");
}
R_RETURN(m_broker->GetOutData().Pop(out_storage.Get()));
}