From 456145cf8eb8d77cdba143a6b48833fd99ecf3fa Mon Sep 17 00:00:00 2001 From: mika-n Date: Tue, 23 Apr 2019 12:32:12 +0300 Subject: [PATCH] Fixed a bug described in #664 issue where gyro mouse doesn't get correct properties (for example toggle option) right after Startup or Hotplug LoadProfile calls. The mouse object was created after LoadProfile function even when LoadProfile function tries to set few properties of that mouse object. --- DS4Windows/DS4Control/ControlService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs index fd5f350..b541509 100644 --- a/DS4Windows/DS4Control/ControlService.cs +++ b/DS4Windows/DS4Control/ControlService.cs @@ -403,6 +403,9 @@ namespace DS4Windows device.SyncChange += this.On_SyncChange; device.SyncChange += DS4Devices.UpdateSerial; device.SerialChange += this.On_SerialChange; + + touchPad[i] = new Mouse(i, device); + if (!useTempProfile[i]) { if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) @@ -417,7 +420,6 @@ namespace DS4Windows LoadProfile(i, false, this, false, false); } - touchPad[i] = new Mouse(i, device); device.LightBarColor = getMainColor(i); if (!getDInputOnly(i) && device.isSynced()) @@ -641,6 +643,9 @@ namespace DS4Windows device.SyncChange += this.On_SyncChange; device.SyncChange += DS4Devices.UpdateSerial; device.SerialChange += this.On_SerialChange; + + touchPad[Index] = new Mouse(Index, device); + if (!useTempProfile[Index]) { if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) @@ -655,7 +660,6 @@ namespace DS4Windows LoadProfile(Index, false, this, false, false); } - touchPad[Index] = new Mouse(Index, device); device.LightBarColor = getMainColor(Index); int tempIdx = Index;