mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
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.
This commit is contained in:
@@ -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<string, IntPtr> _monitorIdToHandleMap = new();
|
||||
private bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Get physical handle for monitor using its unique Id
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the handle mapping with new handles
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user