finalize process when requested by uMenu

This commit is contained in:
lizzie
2026-05-21 05:52:31 +00:00
committed by crueter
parent bd6e843037
commit 6069529cec
5 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -407,7 +407,7 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
// Applet was started by frontend, so it is foreground.
applet->lifecycle_manager.SetFocusState(FocusState::InFocus);
if (applet->applet_id == AppletId::QLaunch) {
if (applet->applet_id == AppletId::QLaunch || applet->applet_id == AppletId::UlauncherUmenu) {
applet->lifecycle_manager.SetFocusHandlingMode(false);
applet->lifecycle_manager.SetOutOfFocusSuspendingEnabled(false);
m_window_system->TrackApplet(applet, false);
@@ -16,6 +16,7 @@
#include "core/hle/service/am/process_creation.h"
#include "core/hle/service/am/service/library_applet_self_accessor.h"
#include "core/hle/service/am/service/storage.h"
#include "core/hle/service/am/window_system.h"
#include "core/hle/service/cmif_serialization.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/glue/glue_manager.h"
@@ -102,10 +103,9 @@ Result ILibraryAppletSelfAccessor::PopInData(Out<SharedPointer<IStorage>> out_st
// uLauncher emulation
static Result UloaderCreateApplication(Core::System& system, u64 program_id) {
FileSys::VirtualFile nca_raw{};
// Get the program NCA from storage.
auto& storage = system.GetContentProviderUnion();
nca_raw = storage.GetEntryRaw(program_id, FileSys::ContentRecordType::Program);
FileSys::VirtualFile nca_raw = storage.GetEntryRaw(program_id, FileSys::ContentRecordType::Program);
// Ensure we retrieved a program NCA.
R_UNLESS(nca_raw != nullptr, ResultUnknown);
std::vector<u8> control;
@@ -118,7 +118,7 @@ static Result UloaderCreateApplication(Core::System& system, u64 program_id) {
applet->applet_id = AppletId::Application;
applet->type = AppletType::Application;
applet->library_applet_mode = LibraryAppletMode::AllForeground;
//window_system.TrackApplet(applet, true);
system.GetAppletManager().GetWindowSystem()->TrackApplet(applet, true);
R_SUCCEED();
}
@@ -176,9 +176,8 @@ Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage)
u64 args_value{};
std::memcpy(std::addressof(args_value), req_data.data() + sizeof(req_cmd), sizeof(args_value));
LOG_WARNING(Service_AM, "program_id={:016x}", args_value);
m_applet->process->Terminate();
UloaderCreateApplication(system, args_value);
R_SUCCEED();
break;
}
case SystemMessage::ResumeApplication:
case SystemMessage::TerminateApplication:
@@ -203,6 +202,8 @@ Result ILibraryAppletSelfAccessor::PushOutData(SharedPointer<IStorage> storage)
case SystemMessage::NotifyWarnedAboutOutdatedTheme:
break;
case SystemMessage::TerminateMenu:
m_applet->process->Terminate();
system.GetAppletManager().GetWindowSystem()->RequestApplicationToGetForeground();
break;
case SystemMessage::OpenControllerKeyRemapping:
break;
+1 -1
View File
@@ -59,7 +59,7 @@ void WindowSystem::Update() {
void WindowSystem::TrackApplet(std::shared_ptr<Applet> applet, bool is_application) {
std::scoped_lock lk{m_lock};
if (applet->applet_id == AppletId::QLaunch) {
if (applet->applet_id == AppletId::QLaunch || applet->applet_id == AppletId::UlauncherUmenu) {
ASSERT(m_home_menu == nullptr);
m_home_menu = applet.get();
} else if (applet->applet_id == AppletId::OverlayDisplay) {