Refactor IPC and enhance PowerDisplay functionality

Refactored IPC communication by introducing a `NamedPipeProcessor` utility for unidirectional named pipe handling, replacing the old bidirectional implementation. Simplified application lifecycle management by removing mutex usage and relying on `AppInstance` for single-instance enforcement.

Replaced IPC-based monitor updates with file-based updates, saving monitor data to `settings.json` for the Settings UI. Added an `ActivationShortcut` property to PowerDisplay settings and updated the settings page UI to support shortcut configuration.

Simplified named pipe creation in `PowerDisplayProcessManager` by removing bidirectional pipe logic and focusing on unidirectional communication. Improved `MainWindow` initialization with an `EnsureInitializedAsync` method.

Updated localization resources and integrated PowerDisplay into the launcher menu. Removed redundant code, improved logging, and streamlined resource cleanup for better maintainability.
This commit is contained in:
Yu Leng
2025-11-12 16:36:43 +08:00
parent e90c4273f7
commit 5d63ca7a9c
12 changed files with 234 additions and 396 deletions

View File

@@ -87,6 +87,12 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
set => SetSettingsProperty(_settings.Properties.RestoreSettingsOnStartup, value, v => _settings.Properties.RestoreSettingsOnStartup = v);
}
public HotkeySettings ActivationShortcut
{
get => _settings.Properties.ActivationShortcut;
set => SetSettingsProperty(_settings.Properties.ActivationShortcut, value, v => _settings.Properties.ActivationShortcut = v);
}
public string BrightnessUpdateRate
{
get => _settings.Properties.BrightnessUpdateRate;