diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index f5ef561..8bdb234 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -153,6 +153,7 @@ namespace DS4Windows device.Report += this.On_Report; TouchPadOn(i, device); + device.setIdleTimeout(getIdleDisconnectTimeout(i)); device.StartUpdate(); //string filename = ProfilePath[ind]; //ind++; @@ -342,6 +343,7 @@ namespace DS4Windows } TouchPadOn(Index, device); + device.setIdleTimeout(getIdleDisconnectTimeout(Index)); CheckProfileOptions(Index, device); device.StartUpdate(); @@ -419,7 +421,6 @@ namespace DS4Windows device.SixAxis.SixAccelMoved += tPad.sixaxisMoved; //LogDebug("Touchpad mode for " + device.MacAddress + " is now " + tmode.ToString()); //Log.LogToTray("Touchpad mode for " + device.MacAddress + " is now " + tmode.ToString()); - //ControllerStatusChanged(this); } public string getDS4ControllerInfo(int index) @@ -590,7 +591,6 @@ namespace DS4Windows inWarnMonitor[ind] = false; useDInputOnly[ind] = false; OnControllerRemoved(this, ind); - //ControllerStatusChanged(this); } } } @@ -650,7 +650,6 @@ namespace DS4Windows else if (pState.Battery != cState.Battery) { OnBatteryStatusChange(this, ind, cState.Battery); - //ControllerStatusChanged(this); } if (getEnableTouchToggle(ind)) @@ -690,8 +689,6 @@ namespace DS4Windows // Output any synthetic events. Mapping.Commit(ind); - // Pull settings updates. - device.setIdleTimeout(getIdleDisconnectTimeout(ind)); } } diff --git a/DS4Windows/DS4Forms/Options.cs b/DS4Windows/DS4Forms/Options.cs index 60db84c..7b1a345 100644 --- a/DS4Windows/DS4Forms/Options.cs +++ b/DS4Windows/DS4Forms/Options.cs @@ -1688,6 +1688,16 @@ namespace DS4Windows root.OptionsClosed(); Visible = false; e.Cancel = true; + + if (device < 4) + { + DS4Device tempDev = Program.rootHub.DS4Controllers[device]; + if (tempDev != null) + { + int discon = getIdleDisconnectTimeout(device); + tempDev.queueEvent(() => { tempDev.setIdleTimeout(discon); }); + } + } } private void cBSlide_CheckedChanged(object sender, EventArgs e) diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index c6d3f0f..6aa3aaa 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -803,7 +803,7 @@ namespace DS4Windows cState.CopyTo(pState); - /*lock (eventQueueLock) + lock (eventQueueLock) { Action tempAct = null; //while (eventQueue.TryDequeue(out tempAct)) @@ -813,7 +813,6 @@ namespace DS4Windows tempAct.Invoke(); } } - */ } }