mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Seems to best fix issues with suspending. The delay is MS fault
Related to issue #730
This commit is contained in:
parent
af9557e53b
commit
1f66d984cd
@ -652,6 +652,7 @@ namespace DS4Windows.Forms
|
||||
DS4LightBar.shuttingdown = false;
|
||||
wasrunning = false;
|
||||
Program.rootHub.suspending = false;
|
||||
Thread.Sleep(8000);
|
||||
this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
|
||||
}
|
||||
|
||||
@ -663,13 +664,17 @@ namespace DS4Windows.Forms
|
||||
{
|
||||
DS4LightBar.shuttingdown = true;
|
||||
Program.rootHub.suspending = true;
|
||||
this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
|
||||
wasrunning = true;
|
||||
changingService = true;
|
||||
|
||||
while (this.changingService)
|
||||
{
|
||||
Thread.SpinWait(500);
|
||||
}
|
||||
Program.rootHub.Stop(true);
|
||||
|
||||
Invoke((System.Action)(() => {
|
||||
ServiceShutdownFinish();
|
||||
btnStartStop.Enabled = false;
|
||||
}));
|
||||
changingService = false;
|
||||
//this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
|
||||
wasrunning = true;
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user