From 858fe0a481980f3c886da6b65ade698cb8c45983 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 5 Jan 2019 00:07:00 -0600 Subject: [PATCH] Fix power state flags. Make sure to invoke a call on main thread --- DS4Windows/DS4Forms/DS4Form.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 6c19bb4..297ee34 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -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; }