mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 10:12:46 +01:00
wip: when exiting applet, track the calling applet
This commit is contained in:
parent
a9312c837e
commit
dd5d36a796
3 changed files with 16 additions and 0 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,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, true);
|
||||
m_window_system->RequestApplicationToGetForeground();
|
||||
}
|
||||
|
||||
} // 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 TrackApplet(std::shared_ptr<Applet> applet, bool is_application);
|
||||
|
||||
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"
|
||||
|
@ -177,6 +178,13 @@ 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, "HAS CALLER");
|
||||
system.GetAppletManager().TrackApplet(applet, true);
|
||||
applet->lifecycle_manager.SetFocusState(FocusState::InFocus);
|
||||
}
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue