am: use WindowSystem for window visibility update

This commit is contained in:
Liam 2024-02-25 21:23:33 -05:00
parent 03c21e57da
commit d3ab172afb

View File

@ -4,6 +4,7 @@
#include "core/hle/service/am/applet.h" #include "core/hle/service/am/applet.h"
#include "core/hle/service/am/applet_manager.h" #include "core/hle/service/am/applet_manager.h"
#include "core/hle/service/am/service/window_controller.h" #include "core/hle/service/am/service/window_controller.h"
#include "core/hle/service/am/window_system.h"
#include "core/hle/service/cmif_serialization.h" #include "core/hle/service/cmif_serialization.h"
namespace Service::AM { namespace Service::AM {
@ -65,13 +66,9 @@ Result IWindowController::RejectToChangeIntoBackground() {
} }
Result IWindowController::SetAppletWindowVisibility(bool visible) { Result IWindowController::SetAppletWindowVisibility(bool visible) {
LOG_WARNING(Service_AM, "(STUBBED) called"); LOG_INFO(Service_AM, "called");
std::scoped_lock lk{m_applet->lock}; m_window_system.RequestAppletVisibilityState(*m_applet, visible);
m_applet->lifecycle_manager.SetFocusState(visible ? FocusState::InFocus
: FocusState::NotInFocus);
m_applet->SetInteractibleLocked(visible);
m_applet->UpdateSuspensionStateLocked(true);
R_SUCCEED(); R_SUCCEED();
} }