From a1490303d4223548f908f84ac50e048ea0f994cd Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Fri, 30 Oct 2026 11:42:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=AB=98=E4=BA=AE=E6=A1=86=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E9=9A=90=E8=97=8F=EF=BC=8C=E4=BB=85=E6=9C=89=E6=95=88?= =?UTF-8?q?=E7=9F=A9=E5=BD=A2=E6=97=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/desktop-picker.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/desktop-picker.ps1 b/resources/desktop-picker.ps1 index 7797001..61c97c4 100644 --- a/resources/desktop-picker.ps1 +++ b/resources/desktop-picker.ps1 @@ -79,6 +79,10 @@ $hl.Show() $stage = "hover" $chain = New-Object System.Collections.ArrayList $selIdx = -1 +$script:lastX = -1 +$script:lastY = -1 +$script:lastMove = Get-Date +$script:pending = $false $prevSpace = $false $prevPgUp = $false $prevPgDn = $false @@ -94,6 +98,13 @@ while ($true) { if ($stage -eq "hover") { $ptX = [System.Windows.Forms.Cursor]::Position.X $ptY = [System.Windows.Forms.Cursor]::Position.Y + if ($ptX -ne $script:lastX -or $ptY -ne $script:lastY) { + $script:lastX = $ptX; $script:lastY = $ptY + $script:lastMove = Get-Date + $script:pending = $true + } + $idle = ((Get-Date) - $script:lastMove).TotalMilliseconds -ge 250 + if (-not $idle) { Start-Sleep -Milliseconds 60; return } $el = Get-DeepestAtPoint $ptX $ptY if ($el) { $c = $el.Current