From ed09317f149fef04c6546380072b8f1b4bb3302c Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Thu, 12 Oct 2017 21:15:42 -0500 Subject: [PATCH] Fix toggling Hide DS4 Controller option --- DS4Windows/DS4Forms/DS4Form.cs | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index c3d2a0d..9a6aadb 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -1544,9 +1544,33 @@ namespace DS4Windows if (Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build < 10586) btnConnectDS4Win10.Visible = exclusiveMode; - btnStartStop_Clicked(false); - btnStartStop_Clicked(false); + hideDS4CheckBox.Enabled = false; Save(); + btnStartStop_Clicked(false); + finishHideDS4CheckBox(); + } + + private async void finishHideDS4CheckBox() + { + await TaskRunner.Factory.StartNew(() => + { + while (changingService) + { + Thread.Sleep(10); + } + }); + + btnStartStop_Clicked(false); + + await TaskRunner.Factory.StartNew(() => + { + while (changingService) + { + Thread.Sleep(10); + } + }); + + hideDS4CheckBox.Enabled = true; } private void startMinimizedCheckBox_CheckedChanged(object sender, EventArgs e)