mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 20:44:20 +01:00
Make lastActive field matter for USB connections again. Related to issue #45.
This commit is contained in:
parent
9f554cf6c1
commit
19afe15937
@ -876,26 +876,32 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
bool ds4Idle = cState.FrameCounter == pState.FrameCounter;
|
||||
if (!ds4Idle)
|
||||
bool ds4ActiveFrame = cState.FrameCounter == pState.FrameCounter;
|
||||
if (!ds4ActiveFrame)
|
||||
{
|
||||
isRemoved = false;
|
||||
}
|
||||
|
||||
if (conType == ConnectionType.USB)
|
||||
{
|
||||
lastActive = utcNow;
|
||||
if (idleTimeout == 0)
|
||||
{
|
||||
lastActive = utcNow;
|
||||
}
|
||||
else if (!isDS4Idle())
|
||||
{
|
||||
lastActive = utcNow;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bool shouldDisconnect = false;
|
||||
int idleTime = idleTimeout;
|
||||
if (!isRemoved && idleTime > 0)
|
||||
if (!isRemoved && idleTimeout > 0)
|
||||
{
|
||||
bool idleInput = isDS4Idle();
|
||||
if (idleInput)
|
||||
{
|
||||
DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTime);
|
||||
DateTime timeout = lastActive + TimeSpan.FromSeconds(idleTimeout);
|
||||
if (!charging)
|
||||
shouldDisconnect = utcNow >= timeout;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user