From 0473747f9460a7180227e8e14fbeee73905d74c0 Mon Sep 17 00:00:00 2001 From: MaranBr Date: Sun, 31 May 2026 03:55:12 +0200 Subject: [PATCH] [am] Fix application state notification (#4027) This fixed issues in Mario Kart 8 multiplayer where the native controller applet would pop up, then once A was pressed and it exited, it would freeze the game but music would continue playing. The issue was that UpdateRequestedFocusState() updates the focus state but never sets m_has_focus_state_changed for applications. Since ShouldSignalSystemEvent() checks that flag for applications, they never receive FocusStateChanged messages when LLE library applets exit. The game keeps running (hence the music) but is stuck waiting for a focus notification that never arrives. HLE applets aren't affected because their dummy process has is_process_running=false, so the game is never considered obscured in the first place. Credits: [davidcollini](https://github.com/davidcollini) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4027 Reviewed-by: Lizzie Reviewed-by: crueter --- src/core/hle/service/am/lifecycle_manager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/hle/service/am/lifecycle_manager.cpp b/src/core/hle/service/am/lifecycle_manager.cpp index fbb9ad611f..a79ef6f5f5 100644 --- a/src/core/hle/service/am/lifecycle_manager.cpp +++ b/src/core/hle/service/am/lifecycle_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -372,6 +375,10 @@ bool LifecycleManager::UpdateRequestedFocusState() { // Mark the focus state as ready for update. m_requested_focus_state = new_state; + if (m_is_application) { + m_has_focus_state_changed = true; + } + // We changed the focus state. return true; }