From 762a6bce0c07224c685e2dd1a3157f9eb9fb9ea0 Mon Sep 17 00:00:00 2001 From: Yu Leng Date: Wed, 10 Dec 2025 19:09:58 +0800 Subject: [PATCH] Remove GetPhysicalHandle from PhysicalMonitorHandleManager Eliminated the GetPhysicalHandle method, which handled monitor handle lookup by Id or direct handle. This refactors PhysicalMonitorHandleManager to no longer provide handle retrieval logic. --- .../DDC/PhysicalMonitorHandleManager.cs | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/modules/powerdisplay/PowerDisplay.Lib/Drivers/DDC/PhysicalMonitorHandleManager.cs b/src/modules/powerdisplay/PowerDisplay.Lib/Drivers/DDC/PhysicalMonitorHandleManager.cs index 10c7c7ce8d..20c74eb041 100644 --- a/src/modules/powerdisplay/PowerDisplay.Lib/Drivers/DDC/PhysicalMonitorHandleManager.cs +++ b/src/modules/powerdisplay/PowerDisplay.Lib/Drivers/DDC/PhysicalMonitorHandleManager.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using ManagedCommon; -using PowerDisplay.Common.Models; using PowerDisplay.Common.Utils; using static PowerDisplay.Common.Drivers.PInvoke; @@ -20,27 +19,6 @@ namespace PowerDisplay.Common.Drivers.DDC private readonly LockedDictionary _monitorIdToHandleMap = new(); private bool _disposed; - /// - /// Get physical handle for monitor using its unique Id - /// - public IntPtr GetPhysicalHandle(Monitor monitor) - { - // Primary lookup: use monitor Id - if (!string.IsNullOrEmpty(monitor.Id) && - _monitorIdToHandleMap.TryGetValue(monitor.Id, out var handle)) - { - return handle; - } - - // Fallback: use direct handle from monitor object - if (monitor.Handle != IntPtr.Zero) - { - return monitor.Handle; - } - - return IntPtr.Zero; - } - /// /// Update the handle mapping with new handles ///