mirror of
https://git.suyu.dev/suyu/suyu
synced 2025-01-09 16:03:21 +00:00
wip: when exiting applet, track the calling applet
This commit is contained in:
parent
0a3143399a
commit
b5fb367c2e
3 changed files with 15 additions and 2 deletions
|
@ -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::RequestAppletVisibilityState(std::shared_ptr<Applet> applet, bool visible) {
|
||||
m_window_system->RequestAppletVisibilityState(applet.operator*(), visible);
|
||||
}
|
||||
|
||||
} // namespace Service::AM
|
||||
|
|
|
@ -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 RequestAppletVisibilityState(std::shared_ptr<Applet> applet, bool visible);
|
||||
|
||||
private:
|
||||
Core::System& m_system;
|
||||
|
|
|
@ -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"
|
||||
|
@ -17,6 +18,7 @@
|
|||
#include "core/hle/service/ns/application_manager_interface.h"
|
||||
#include "core/hle/service/ns/service_getter_interface.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
#include "core/hle/service/am/am_results.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
|
@ -176,7 +178,12 @@ Result ILibraryAppletSelfAccessor::GetMainAppletStorageId(Out<FileSys::StorageId
|
|||
|
||||
Result ILibraryAppletSelfAccessor::ExitProcessAndReturn() {
|
||||
LOG_INFO(Service_AM, "called");
|
||||
std::shared_ptr<Applet> applet = m_applet->caller_applet.lock();
|
||||
LOG_INFO(Service_AM, "unlocking caller applet");
|
||||
system.GetAppletManager().RequestAppletVisibilityState(applet, true);
|
||||
applet->SetInteractibleLocked(true);
|
||||
m_applet->process->Terminate();
|
||||
m_applet->terminate_result = AM::ResultLibraryAppletTerminated;
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
@ -278,8 +285,7 @@ Result ILibraryAppletSelfAccessor::GetMainAppletApplicationDesiredLanguage(
|
|||
Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out<u64> out_application_id) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// TODO: this should be the main applet, not the caller applet
|
||||
const auto main_applet = GetCallerIdentity(*m_applet);
|
||||
const AppletIdentityInfo main_applet = GetCallerIdentity(*m_applet->caller_applet);
|
||||
*out_application_id = main_applet.application_id;
|
||||
|
||||
R_SUCCEED();
|
||||
|
|
Loading…
Reference in a new issue