diff options
| author | Liam <byteslice@airmail.cc> | 2024-02-04 16:05:44 -0500 | 
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2024-02-09 09:20:53 -0500 | 
| commit | b206ea5cfe90bca01b48e44a0cf93cb51f4877d1 (patch) | |
| tree | 33e6fd07e5dd6e802f71f2830d6c66a2b44fbefd | |
| parent | 70590f79f8fd26d10274dca0b9a3f05f3c0ebd9e (diff) | |
am: fix focus states and display of indirect keyboard
| -rw-r--r-- | src/core/hle/service/am/library_applet_creator.cpp | 18 | ||||
| -rw-r--r-- | src/core/hle/service/am/system_buffer_manager.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/am/window_controller.cpp | 4 | 
3 files changed, 10 insertions, 15 deletions
diff --git a/src/core/hle/service/am/library_applet_creator.cpp b/src/core/hle/service/am/library_applet_creator.cpp index a883a021e..c48ed29bc 100644 --- a/src/core/hle/service/am/library_applet_creator.cpp +++ b/src/core/hle/service/am/library_applet_creator.cpp @@ -118,23 +118,17 @@ std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system,      switch (mode) {      case LibraryAppletMode::AllForeground:      case LibraryAppletMode::NoUi: -        applet->focus_state = FocusState::InFocus; +    case LibraryAppletMode::PartialForeground: +    case LibraryAppletMode::PartialForegroundIndirectDisplay:          applet->hid_registration.EnableAppletToGetInput(true); +        applet->focus_state = FocusState::InFocus;          applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoForeground); -        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged);          break;      case LibraryAppletMode::AllForegroundInitiallyHidden: -        applet->system_buffer_manager.SetWindowVisibility(false); -        applet->focus_state = FocusState::NotInFocus;          applet->hid_registration.EnableAppletToGetInput(false); -        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged); -        break; -    case LibraryAppletMode::PartialForeground: -    case LibraryAppletMode::PartialForegroundIndirectDisplay: -    default: -        applet->focus_state = FocusState::Background; -        applet->hid_registration.EnableAppletToGetInput(true); -        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged); +        applet->focus_state = FocusState::NotInFocus; +        applet->system_buffer_manager.SetWindowVisibility(false); +        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoBackground);          break;      } diff --git a/src/core/hle/service/am/system_buffer_manager.cpp b/src/core/hle/service/am/system_buffer_manager.cpp index 7fb9e3a75..48923fe41 100644 --- a/src/core/hle/service/am/system_buffer_manager.cpp +++ b/src/core/hle/service/am/system_buffer_manager.cpp @@ -38,7 +38,8 @@ bool SystemBufferManager::Initialize(Nvnflinger::Nvnflinger* nvnflinger, Kernel:      }      Nvnflinger::LayerBlending blending = Nvnflinger::LayerBlending::None; -    if (mode == LibraryAppletMode::PartialForeground) { +    if (mode == LibraryAppletMode::PartialForeground || +        mode == LibraryAppletMode::PartialForegroundIndirectDisplay) {          blending = Nvnflinger::LayerBlending::Coverage;      } diff --git a/src/core/hle/service/am/window_controller.cpp b/src/core/hle/service/am/window_controller.cpp index f00957f83..c07ef228b 100644 --- a/src/core/hle/service/am/window_controller.cpp +++ b/src/core/hle/service/am/window_controller.cpp @@ -62,12 +62,12 @@ void IWindowController::SetAppletWindowVisibility(HLERequestContext& ctx) {      applet->hid_registration.EnableAppletToGetInput(visible);      if (visible) { -        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoForeground);          applet->focus_state = FocusState::InFocus; +        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoForeground);      } else {          applet->focus_state = FocusState::NotInFocus; +        applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoBackground);      } -    applet->message_queue.PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged);      IPC::ResponseBuilder rb{ctx, 2};      rb.Push(ResultSuccess);  | 
