diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs
index 4df16a8..80f8149 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;
@@ -235,13 +234,11 @@ namespace DS4Windows
break;
}
- if (!(startMinimizedCheckBox.Checked || mini))
+ if (startMinimizedCheckBox.Checked || mini)
{
- mAllowVisible = true;
- Show();
+ WindowState = FormWindowState.Minimized;
}
- Form_Resize(null, null);
RefreshProfiles();
/*opt = new Options(this);
opt.Icon = this.Icon;
@@ -392,13 +389,14 @@ namespace DS4Windows
else
{
if (hoverTextDict.TryGetValue(control, out tempst))
- control.MouseEnter += Items_MouseHover;
+ control.MouseHover += Items_MouseHover;
else
control.MouseHover += ClearLastMessage;
}
}
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;
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();
}
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();
//}
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.
-->
-
+