Compare commits

...

3 commits

3 changed files with 17 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,9 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
applet->process->Run();
}
void AppletManager::TrackApplet(std::shared_ptr<Applet> applet, bool is_application) {
m_window_system->TrackApplet(applet, false);
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 TrackApplet(std::shared_ptr<Applet> applet, bool is_application);
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/core_timing.h"
@ -177,6 +178,14 @@ Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out<FileSys::StorageId
Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() {
LOG_INFO(Service_AM, "called");
m_applet->process->Terminate();
if(!m_applet->caller_applet.expired()) {
std::shared_ptr<Applet> applet = m_applet->caller_applet.lock();
if(applet == nullptr) R_SUCCEED();
LOG_INFO(Service_AM, "tracking caller applet");
// todo: is_application is set to false as window_system doesn't allow re-tracking without replacing the application
system.GetAppletManager().TrackApplet(applet, false);
applet->lifecycle_manager.SetFocusState(FocusState::InFocus);
}
R_SUCCEED();
}