From 56903bce1f2082200567da93ec91f0cc98edfc13 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 17 Nov 2018 07:51:12 -0600 Subject: [PATCH 1/5] Removed unnecessary method override at this point --- DS4Windows/DS4Forms/DS4Form.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 4df16a8..e91535f 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -52,7 +52,6 @@ namespace DS4Windows Options opt; private bool optPop; public Size oldsize; - public bool mAllowVisible; bool contextclose; bool turnOffTemp; bool runningBat; @@ -237,11 +236,9 @@ namespace DS4Windows if (!(startMinimizedCheckBox.Checked || mini)) { - mAllowVisible = true; Show(); } - Form_Resize(null, null); RefreshProfiles(); /*opt = new Options(this); opt.Icon = this.Icon; @@ -399,6 +396,7 @@ namespace DS4Windows } instance = this; + Form_Resize(null, null); if (btnStartStop.Enabled && start) TaskRunner.Delay(50).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked()))); } @@ -500,17 +498,6 @@ namespace DS4Windows } } - protected override void SetVisibleCore(bool value) - { - if (!mAllowVisible) - { - value = false; - if (!IsHandleCreated) CreateHandle(); - } - - base.SetVisibleCore(value); - } - public static string GetTopWindowName() { IntPtr hWnd = GetForegroundWindow(); @@ -1591,7 +1578,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question private void editMenu_Click(object sender, EventArgs e) { - mAllowVisible = true; Show(); WindowState = FormWindowState.Normal; ToolStripMenuItem em = (ToolStripMenuItem)sender; @@ -1741,7 +1727,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question private void openToolStripMenuItem_Click(object sender, EventArgs e) { - mAllowVisible = true; Show(); Focus(); WindowState = FormWindowState.Normal; From 2990013907495e4dabd47e66d87df9f874f2eba6 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 17 Nov 2018 08:09:36 -0600 Subject: [PATCH 2/5] Corrected event to watch --- DS4Windows/DS4Forms/DS4Form.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index e91535f..c8c931b 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -389,7 +389,7 @@ namespace DS4Windows else { if (hoverTextDict.TryGetValue(control, out tempst)) - control.MouseEnter += Items_MouseHover; + control.MouseHover += Items_MouseHover; else control.MouseHover += ClearLastMessage; } From 43855ef9347af3942a8e10ee7545e1b82b2d28fb Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 17 Nov 2018 08:57:18 -0600 Subject: [PATCH 3/5] Fixed start minimized option --- DS4Windows/DS4Forms/DS4Form.cs | 4 ++-- DS4Windows/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index c8c931b..80f8149 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -234,9 +234,9 @@ namespace DS4Windows break; } - if (!(startMinimizedCheckBox.Checked || mini)) + if (startMinimizedCheckBox.Checked || mini) { - Show(); + WindowState = FormWindowState.Minimized; } RefreshProfiles(); diff --git a/DS4Windows/Program.cs b/DS4Windows/Program.cs index e2d7971..06406da 100644 --- a/DS4Windows/Program.cs +++ b/DS4Windows/Program.cs @@ -103,7 +103,7 @@ namespace DS4Windows //rootHub = new ControlService(); Application.EnableVisualStyles(); ds4form = new DS4Form(args); - Application.Run(ds4form); + Application.Run(); //mutex.ReleaseMutex(); //} From 93acec78aad76d316c465702d716a8a99500c43c Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 17 Nov 2018 18:45:23 -0600 Subject: [PATCH 4/5] Revert to using asInvoker in manifest file Related to issue #487. --- DS4Windows/app.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/app.manifest b/DS4Windows/app.manifest index 281ddfe..c87b5ff 100644 --- a/DS4Windows/app.manifest +++ b/DS4Windows/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From c2edbdf946fd512b03596089b6a40218aff9cf3f Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 17 Nov 2018 18:47:13 -0600 Subject: [PATCH 5/5] Increased timeout for tracking second instance exclusive mode workaround --- DS4Windows/DS4Library/DS4Devices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DS4Windows/DS4Library/DS4Devices.cs b/DS4Windows/DS4Library/DS4Devices.cs index 2636744..0193032 100644 --- a/DS4Windows/DS4Library/DS4Devices.cs +++ b/DS4Windows/DS4Library/DS4Devices.cs @@ -104,7 +104,7 @@ namespace DS4Windows startInfo.Arguments = "re-enabledevice " + devicePathToInstanceId(hDevice.DevicePath); Process child = Process.Start(startInfo); - if (!child.WaitForExit(15000)) + if (!child.WaitForExit(30000)) { child.Kill(); }