diff options
author | Liam <byteslice@airmail.cc> | 2024-01-07 03:21:01 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-01-30 02:17:33 +0100 |
commit | 68303ed6016da0926df8b62e5a0c55c9b914f927 (patch) | |
tree | 35c805cffc86c668ae88641bd42358105ed6751a /src/core/hle/service/am/window_controller.cpp | |
parent | am: return AppletDataBroker and use for frontend applets (diff) | |
download | yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.gz yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.bz2 yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.lz yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.xz yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.tar.zst yuzu-68303ed6016da0926df8b62e5a0c55c9b914f927.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/window_controller.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/core/hle/service/am/window_controller.cpp b/src/core/hle/service/am/window_controller.cpp index 430ca180b..f00957f83 100644 --- a/src/core/hle/service/am/window_controller.cpp +++ b/src/core/hle/service/am/window_controller.cpp @@ -17,8 +17,8 @@ IWindowController::IWindowController(Core::System& system_, std::shared_ptr<Appl {10, &IWindowController::AcquireForegroundRights, "AcquireForegroundRights"}, {11, nullptr, "ReleaseForegroundRights"}, {12, nullptr, "RejectToChangeIntoBackground"}, - {20, nullptr, "SetAppletWindowVisibility"}, - {21, nullptr, "SetAppletGpuTimeSlice"}, + {20, &IWindowController::SetAppletWindowVisibility, "SetAppletWindowVisibility"}, + {21, &IWindowController::SetAppletGpuTimeSlice, "SetAppletGpuTimeSlice"}, }; // clang-format on @@ -52,4 +52,35 @@ void IWindowController::AcquireForegroundRights(HLERequestContext& ctx) { rb.Push(ResultSuccess); } +void IWindowController::SetAppletWindowVisibility(HLERequestContext& ctx) { + LOG_INFO(Service_AM, "called"); + + IPC::RequestParser rp{ctx}; + const bool visible = rp.Pop<bool>(); + + applet->system_buffer_manager.SetWindowVisibility(visible); + applet->hid_registration.EnableAppletToGetInput(visible); + + if (visible) { + applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoForeground); + applet->focus_state = FocusState::InFocus; + } else { + applet->focus_state = FocusState::NotInFocus; + } + applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + +void IWindowController::SetAppletGpuTimeSlice(HLERequestContext& ctx) { + IPC::RequestParser rp{ctx}; + const auto time_slice = rp.Pop<s64>(); + + LOG_WARNING(Service_AM, "(STUBBED) called, time_slice={}", time_slice); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(ResultSuccess); +} + } // namespace Service::AM |