Fix power state flags. Make sure to invoke a call on main thread

This commit is contained in:
Travis Nickles 2019-01-05 00:07:00 -06:00
parent 56517e4751
commit 858fe0a481

View File

@ -539,25 +539,25 @@ namespace DS4Windows
short evType = Convert.ToInt16(e.NewEvent.GetPropertyValue("EventType"));
switch (evType)
{
case 4:
case 7:
{
if (btnStartStop.Text == Properties.Resources.StartText && wasrunning)
{
DS4LightBar.shuttingdown = false;
wasrunning = false;
Program.rootHub.suspending = false;
BtnStartStop_Clicked();
this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
}
break;
}
case 7:
case 4:
{
if (btnStartStop.Text == Properties.Resources.StopText)
{
DS4LightBar.shuttingdown = true;
Program.rootHub.suspending = true;
BtnStartStop_Clicked();
this.Invoke((System.Action)(() => BtnStartStop_Clicked()));
wasrunning = true;
}