From b624dd2b03140d4e4433ce6cec3be36e55bcbc10 Mon Sep 17 00:00:00 2001 From: Yu Leng Date: Mon, 8 Dec 2025 14:17:05 +0800 Subject: [PATCH] Make DisplayChangeWatcher a partial class; add fields The `DisplayChangeWatcher` class is now a partial class, enabling its definition to be split across multiple files. Added two private fields: `_dispatcherQueue` for managing thread-safe operations and `_debounceDelay` for debouncing with a 1-second delay. Updated the `DeviceWatcher` field to use nullable reference types (`DeviceWatcher?`). --- .../powerdisplay/PowerDisplay/Helpers/DisplayChangeWatcher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/powerdisplay/PowerDisplay/Helpers/DisplayChangeWatcher.cs b/src/modules/powerdisplay/PowerDisplay/Helpers/DisplayChangeWatcher.cs index db3ee49f3d..07e949ef9c 100644 --- a/src/modules/powerdisplay/PowerDisplay/Helpers/DisplayChangeWatcher.cs +++ b/src/modules/powerdisplay/PowerDisplay/Helpers/DisplayChangeWatcher.cs @@ -16,7 +16,7 @@ namespace PowerDisplay.Helpers; /// Watches for display/monitor connection changes using WinRT DeviceWatcher. /// Triggers DisplayChanged event when monitors are added, removed, or updated. /// -public sealed class DisplayChangeWatcher : IDisposable +public sealed partial class DisplayChangeWatcher : IDisposable { private readonly DispatcherQueue _dispatcherQueue; private readonly TimeSpan _debounceDelay = TimeSpan.FromSeconds(1);