Repository: PowerToys
Issue: MouseWithoutBorders multiple threads conflicting access to settings.json
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.70.0

### Installation method

WinGet

### Running as admin

Yes

### Area(s) with issue?

Mouse Without Borders

### Steps to reproduce

I'm not sure what is triggering the problem, but I have been configuring & using MouseWithoutBorders on three machines, and had the settings open when I noticed errors in Event Viewer, which are also reported in the MouseWithoutBorders log file.

### ✔️ Expected Behavior

No error messages.

### ❌ Actual Behavior

procmon for Image contains MouseWithoutBorders, Path ends with settings.json:

![image](https://github.com/microsoft/PowerToys/assets/12625179/77b4030c-bd27-4748-a910-4a356b97555f)

MouseWithoutBorders Log (from around the time of the procmon trace):

<details>
<summary>The process cannot access the file '...settings.json' because it is being used by another process, repeated many times.</summary>
<code>

[20:42:12.1904801] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.2441962] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.2910031] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.3331874] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.3341173] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.3867593] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.4344280] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.4788106] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.4794601] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.5320794] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.5329877] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.5776401] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.6682178] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.7419509] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.8057661] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.8098926] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.8716513] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.9188104] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.9910281] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:12.9915978] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.0556116] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.1359485] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.1391849] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.1914971] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.2463655] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.3037688] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.3542964] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.3900095] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4353965] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4371754] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4637630] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4644760] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4658061] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
[20:42:13.4664756] [Error] MouseWithoutBordersSettings::Save
    Exception encountered while saving MouseWithoutBorders settings.
The process cannot access the file 'C:\Users\david\AppData\Local\Microsoft\PowerToys\MouseWithoutBorders\settings.json' because it is being used by another process.
Inner exception: 

Stack trace: 
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
   at Microsoft.PowerToys.Settings.UI.Library.SettingsUtils.SaveSettings(String jsonSettings, String powertoy, String fileName)
</code>
</details>

### Other Software

Windows 11 22H2 22621.1778 and 22621.1702 both show a large number of errors.