[New Utility]Mouse Without Borders

* Integrate Mouse Without Borders into PowerToys

---------

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
Andrey Nekrasov
2023-05-15 23:32:26 +01:00
committed by Jaime Bernardo
parent a0b9af039d
commit 29eebe16a4
304 changed files with 37234 additions and 133 deletions

View File

@@ -7,6 +7,8 @@ using System.Diagnostics;
using System.IO;
using System.IO.Abstractions;
using System.Linq;
using System.Net.NetworkInformation;
using System.Security.Principal;
using Microsoft.PowerToys.Settings.UI.Library.CustomAction;
namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
@@ -15,6 +17,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
{
public static readonly IFileSystem FileSystem = new FileSystem();
public static string UserLocalAppDataPath { get; set; } = string.Empty;
public static bool AllowRunnerToForeground()
{
var result = false;
@@ -69,9 +73,20 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
return watcher;
}
private static string LocalApplicationDataFolder()
public static string LocalApplicationDataFolder()
{
return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
WindowsIdentity currentUser = WindowsIdentity.GetCurrent();
SecurityIdentifier currentUserSID = currentUser.User;
SecurityIdentifier localSystemSID = new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null);
if (currentUserSID.Equals(localSystemSID) && UserLocalAppDataPath != string.Empty)
{
return UserLocalAppDataPath;
}
else
{
return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
}
}
public static string GetPowerToysInstallationFolder()