mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 21:06:58 -05:00
fix: retrack application when guest applet is closed
This commit is contained in:
parent
09578d522b
commit
b69dfd771a
3 changed files with 22 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
|
@ -335,4 +336,8 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
|
||||||
applet->process->Run();
|
applet->process->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppletManager::RequestApplicationToForeground() {
|
||||||
|
m_window_system->RequestApplicationToGetForeground();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@ -46,6 +47,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetWindowSystem(WindowSystem* window_system);
|
void SetWindowSystem(WindowSystem* window_system);
|
||||||
|
void RequestApplicationToForeground();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::System& m_system;
|
Core::System& m_system;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2024 suyu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include "core/hle/service/am/applet_data_broker.h"
|
#include "core/hle/service/am/applet_data_broker.h"
|
||||||
|
@ -101,6 +102,20 @@ Result ILibraryAppletAccessor::PushInData(SharedPointer<IStorage> storage) {
|
||||||
|
|
||||||
Result ILibraryAppletAccessor::PopOutData(Out<SharedPointer<IStorage>> out_storage) {
|
Result ILibraryAppletAccessor::PopOutData(Out<SharedPointer<IStorage>> out_storage) {
|
||||||
LOG_DEBUG(Service_AM, "called");
|
LOG_DEBUG(Service_AM, "called");
|
||||||
|
if(auto caller = m_applet->caller_applet.lock(); caller != nullptr) {
|
||||||
|
LOG_DEBUG(Service_AM, "resuming caller");
|
||||||
|
system.GetAppletManager().RequestApplicationToForeground();
|
||||||
|
caller->lifecycle_manager.SetResumeNotificationEnabled(true);
|
||||||
|
caller->lifecycle_manager.SetFocusState(FocusState::InFocus);
|
||||||
|
caller->lifecycle_manager.RequestResumeNotification();
|
||||||
|
bool result = caller->lifecycle_manager.UpdateRequestedFocusState();
|
||||||
|
LOG_DEBUG(Service_AM, "interactable: {}, runable: {}, result: {}", caller->is_interactible, caller->lifecycle_manager.IsRunnable(), result);
|
||||||
|
// todo: fix interactable spelling
|
||||||
|
caller->SetInteractibleLocked(true);
|
||||||
|
} else {
|
||||||
|
LOG_CRITICAL(Service_AM, "Caller applet pointer is invalid.");
|
||||||
|
LOG_CRITICAL(Service_AM, "The emulator will freeze!");
|
||||||
|
}
|
||||||
R_RETURN(m_broker->GetOutData().Pop(out_storage.Get()));
|
R_RETURN(m_broker->GetOutData().Pop(out_storage.Get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue