revert client convertion permission check for special folder

This commit is contained in:
Lightczx
2024-02-07 10:32:48 +08:00
parent 6fb5cfe25d
commit 82b5d9b12a
6 changed files with 11 additions and 21 deletions

View File

@@ -69,9 +69,12 @@ internal sealed class WindowController
window.Activate();
options.BringToForeground();
AppOptions appOptions = serviceProvider.GetRequiredService<AppOptions>();
UpdateSystemBackdrop(appOptions.BackdropType);
appOptions.PropertyChanged += OnOptionsPropertyChanged;
if (options.UseSystemBackdrop)
{
AppOptions appOptions = serviceProvider.GetRequiredService<AppOptions>();
UpdateSystemBackdrop(appOptions.BackdropType);
appOptions.PropertyChanged += OnOptionsPropertyChanged;
}
subclass.Initialize();

View File

@@ -41,25 +41,21 @@ internal readonly struct WindowOptions
/// </summary>
public readonly bool PersistSize;
public readonly bool UseSystemBackdrop;
/// <summary>
/// 是否使用 Win UI 3 自带的拓展标题栏实现
/// </summary>
public readonly bool UseLegacyDragBarImplementation = !AppWindowTitleBar.IsCustomizationSupported();
/// <summary>
/// 构造一个新的窗体选项
/// </summary>
/// <param name="window">窗体</param>
/// <param name="titleBar">标题栏</param>
/// <param name="initSize">初始尺寸</param>
/// <param name="persistSize">持久化尺寸</param>
public WindowOptions(Window window, FrameworkElement titleBar, SizeInt32 initSize, bool persistSize = false)
public WindowOptions(Window window, FrameworkElement titleBar, SizeInt32 initSize, bool persistSize = false, bool useSystemBackdrop = true)
{
Hwnd = WindowNative.GetWindowHandle(window);
InputNonClientPointerSource = InputNonClientPointerSource.GetForWindowId(window.AppWindow.Id);
TitleBar = titleBar;
InitSize = initSize;
PersistSize = persistSize;
UseSystemBackdrop = useSystemBackdrop;
}
/// <summary>

View File

@@ -27,7 +27,7 @@ internal sealed partial class MainWindow : Window, IWindowOptionsSource, IMinMax
public MainWindow(IServiceProvider serviceProvider)
{
InitializeComponent();
windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), true);
windowOptions = new(this, TitleBarView.DragArea, new(1200, 741), true, false);
this.InitializeController(serviceProvider);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

View File

@@ -130,13 +130,6 @@ internal sealed class LaunchExecutionEnsureGameResourceHandler : ILaunchExecutio
return true;
}
// Program Files has special permissions limitation.
string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
if (folder.StartsWith(programFiles, StringComparison.OrdinalIgnoreCase))
{
return false;
}
try
{
string tempFilePath = Path.Combine(folder, $"{Guid.NewGuid():N}.tmp");

View File

@@ -137,7 +137,6 @@
<None Remove="Resource\Navigation\WikiMonster.png" />
<None Remove="Resource\Navigation\WikiWeapon.png" />
<None Remove="Resource\Segoe Fluent Icons.ttf" />
<None Remove="Resource\TestBackground.jpg" />
<None Remove="Resource\WelcomeView_Background.png" />
<None Remove="stylecop.json" />
<None Remove="View\Card\AchievementCard.xaml" />
@@ -281,7 +280,6 @@
<Content Include="Resource\Navigation\WikiAvatar.png" />
<Content Include="Resource\Navigation\WikiMonster.png" />
<Content Include="Resource\Navigation\WikiWeapon.png" />
<Content Include="Resource\TestBackground.jpg" />
<Content Include="Resource\WelcomeView_Background.png" />
</ItemGroup>