mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-11-24 20:24:16 +00:00
808380690c
* am/gui: Implement Wake-up message. This implement the ability to send a Wake-up (Resume) message to the guest. Sometime games needs to Sleep and Wake-up the switch to unlock some ingame features. * Address gdkchan feedback
33 lines
No EOL
981 B
C#
33 lines
No EOL
981 B
C#
using Ryujinx.HLE.HOS.Kernel.Threading;
|
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy;
|
|
using System.Collections.Concurrent;
|
|
|
|
namespace Ryujinx.HLE.HOS.SystemState
|
|
{
|
|
class AppletStateMgr
|
|
{
|
|
public ConcurrentQueue<MessageInfo> Messages { get; }
|
|
|
|
public FocusState FocusState { get; private set; }
|
|
|
|
public KEvent MessageEvent { get; }
|
|
|
|
public IdDictionary AppletResourceUserIds { get; }
|
|
|
|
public AppletStateMgr(Horizon system)
|
|
{
|
|
Messages = new ConcurrentQueue<MessageInfo>();
|
|
MessageEvent = new KEvent(system.KernelContext);
|
|
|
|
AppletResourceUserIds = new IdDictionary();
|
|
}
|
|
|
|
public void SetFocus(bool isFocused)
|
|
{
|
|
FocusState = isFocused ? FocusState.InFocus : FocusState.OutOfFocus;
|
|
|
|
Messages.Enqueue(MessageInfo.FocusStateChanged);
|
|
MessageEvent.ReadableEvent.Signal();
|
|
}
|
|
}
|
|
} |