mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-08 13:11:02 +00:00
finalize process when requested by uMenu
This commit is contained in:
@@ -86,7 +86,9 @@ constexpr size_t SlabCountKDeviceAddressSpace = 300;
|
||||
constexpr size_t SlabCountKSession = 1133;
|
||||
constexpr size_t SlabCountKLightSession = 100;
|
||||
constexpr size_t SlabCountKObjectName = 7;
|
||||
constexpr size_t SlabCountKResourceLimit = 5;
|
||||
// Slight divergence to allow for uLaunch to work properly
|
||||
// TODO(lizzie): This should be 5, shouldn't it?
|
||||
constexpr size_t SlabCountKResourceLimit = 5 + 8;
|
||||
constexpr size_t SlabCountKDebug = Core::Hardware::NUM_CPU_CORES;
|
||||
constexpr size_t SlabCountKIoPool = 1;
|
||||
constexpr size_t SlabCountKIoRegion = 6;
|
||||
|
||||
@@ -406,7 +406,7 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
|
||||
// Applet was started by frontend, so it is foreground.
|
||||
applet->lifecycle_manager.SetFocusState(m_system.Kernel(), 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();
|
||||
}
|
||||
|
||||
@@ -175,9 +175,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:
|
||||
@@ -202,6 +201,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;
|
||||
|
||||
@@ -62,7 +62,7 @@ void WindowSystem::TrackApplet(std::shared_ptr<Applet> applet, bool is_applicati
|
||||
{
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user