This commit is contained in:
2025-10-01 00:49:12 +08:00
parent 46b064b0a8
commit 07a62d2f78
18 changed files with 229 additions and 52 deletions
@@ -229,7 +229,7 @@ namespace Ink_Canvas.Helpers
private readonly Dictionary<IntPtr, DateTime> _lastScanTime = new Dictionary<IntPtr, DateTime>();
private readonly HashSet<IntPtr> _knownWindows = new HashSet<IntPtr>();
private readonly Dictionary<string, DateTime> _processLastScanTime = new Dictionary<string, DateTime>();
private int _consecutiveEmptyScans = 0;
private int _consecutiveEmptyScans;
private DateTime _lastSuccessfulScan = DateTime.Now;
private readonly object _scanLock = new object();
+3 -3
View File
@@ -24,12 +24,12 @@ namespace Ink_Canvas.Helpers
// 多屏幕支持相关字段
private Screen _currentScreen;
private bool _isMultiScreenMode = false;
private bool _isMultiScreenMode;
private bool _enableScreenSpecificHotkeys = true; // 是否启用基于屏幕的热键注册
// 智能热键管理相关字段
private bool _isWindowFocused = false;
private bool _isMouseOverWindow = false;
private bool _isWindowFocused;
private bool _isMouseOverWindow;
private System.Windows.Threading.DispatcherTimer _mousePositionTimer;
// 配置文件路径
+1 -1
View File
@@ -30,7 +30,7 @@ namespace Ink_Canvas.Helpers
public class StrokeVisual : DrawingVisual
{
private bool _needsRedraw = true;
private int _lastPointCount = 0;
private int _lastPointCount;
private const int REDRAW_THRESHOLD = 3;
/// <summary>
+1 -1
View File
@@ -37,7 +37,7 @@ namespace Ink_Canvas.Helpers
private const int MinSwitchIntervalMs = 100; // 最小切换间隔100毫秒
// 内存管理相关字段
private long _totalMemoryUsage = 0;
private long _totalMemoryUsage;
private const long MaxMemoryUsageBytes = 100 * 1024 * 1024; // 100MB限制
private DateTime _lastMemoryCleanup = DateTime.MinValue;
private const int MemoryCleanupIntervalMinutes = 5; // 5分钟清理一次