From dc8c781d7a8a6778e493cca798cf2a7d298983de Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sat, 17 Apr 2021 17:57:03 +0100 Subject: [PATCH] Return focus from controller applet after completion (#2218) * Return focus from controller applet after completion This fixes controller applet related in Mario Kart 8 Deluxe, in 2 player mode or when opening the applet in character select. * Return focus for player select --- Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs | 2 ++ Ryujinx.HLE/HOS/Applets/PlayerSelect/PlayerSelectApplet.cs | 2 ++ Ryujinx.HLE/HOS/Horizon.cs | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs b/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs index 4f806225..fd89e8f6 100644 --- a/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs @@ -105,6 +105,8 @@ namespace Ryujinx.HLE.HOS.Applets _normalSession.Push(BuildResponse(result)); AppletStateChanged?.Invoke(this, null); + _system.ReturnFocus(); + return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Applets/PlayerSelect/PlayerSelectApplet.cs b/Ryujinx.HLE/HOS/Applets/PlayerSelect/PlayerSelectApplet.cs index 9cfe0253..7d77b83c 100644 --- a/Ryujinx.HLE/HOS/Applets/PlayerSelect/PlayerSelectApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/PlayerSelect/PlayerSelectApplet.cs @@ -30,6 +30,8 @@ namespace Ryujinx.HLE.HOS.Applets AppletStateChanged?.Invoke(this, null); + _system.ReturnFocus(); + return ResultCode.Success; } diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 0f66192a..fa88d775 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -330,6 +330,11 @@ namespace Ryujinx.HLE.HOS } } + public void ReturnFocus() + { + AppletState.SetFocus(true); + } + public void SimulateWakeUpMessage() { AppletState.Messages.Enqueue(MessageInfo.Resume);