Skip to content

Commit

Permalink
Use immediate unplug upon Windows suspend
Browse files Browse the repository at this point in the history
Related to issue Ryochan7#2084
  • Loading branch information
Ryochan7 committed Apr 21, 2021
1 parent f624f9f commit e19aa7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DS4Windows/DS4Control/ControlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ public void PrepareAbort()
}
}

public bool Stop(bool showlog = true)
public bool Stop(bool showlog = true, bool immediateUnplug = false)
{
if (running)
{
Expand Down Expand Up @@ -1405,7 +1405,7 @@ public bool Stop(bool showlog = true)
OutputDevice tempout = outputDevices[i];
if (tempout != null)
{
UnplugOutDev(i, tempDevice, immediate: false, force: true);
UnplugOutDev(i, tempDevice, immediate: immediateUnplug, force: true);
anyUnplugged = true;
}

Expand Down
2 changes: 1 addition & 1 deletion DS4Windows/DS4Forms/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ private void PowerEventArrive(object sender, EventArrivedEventArgs e)
StartStopBtn.IsEnabled = false;
}));

App.rootHub.Stop();
App.rootHub.Stop(immediateUnplug: true);
wasrunning = true;
}

Expand Down

0 comments on commit e19aa7e

Please sign in to comment.