diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e25d7..dffc7f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to OctoLatency are documented in this file. ## [Unreleased] +## [1.2] +### Fixed +- Drag could get permanently stuck following the cursor: `OnMouseUp` only fires while the mouse is still over the frame at the instant the button is released, which a quick flick of this small (90x24) frame easily misses. `OnUpdate` now polls `IsMouseButtonDown("LeftButton")` every frame and stops the drag as soon as the button is released, regardless of where the cursor ends up. + ## [1.1] ### Added - `/octolat copyerrors`, opening a copy-errors window: a multi-line `EditBox` pre-filled with the error log and auto-highlighted, so the text can be selected and copied with Ctrl+C (vanilla WoW's chat frame doesn't support text selection). diff --git a/OctoLatency.lua b/OctoLatency.lua index 7e8d489..22fa161 100644 --- a/OctoLatency.lua +++ b/OctoLatency.lua @@ -94,6 +94,15 @@ local function OctoLatency_UpdateText() end function OctoLatency_OnUpdate(elapsed) + -- OnMouseUp only fires while the cursor is still over the frame at + -- release, which a quick flick of this small frame easily misses, + -- leaving it stuck following the cursor forever. Poll the actual + -- button state every frame so it lets go regardless of where the + -- mouse ends up. + if (this.isMoving and not IsMouseButtonDown("LeftButton")) then + OctoLatency_StopMoving(this) + end + elapsedTimer = elapsedTimer + elapsed if (elapsedTimer < UPDATE_INTERVAL) then return diff --git a/OctoLatency.toc b/OctoLatency.toc index 0b8c2d8..d9bd858 100644 --- a/OctoLatency.toc +++ b/OctoLatency.toc @@ -2,7 +2,7 @@ ## Title: |cff003c00O|cff005000c|cff006300t|cff007700o|cff008a00L|cff009e00a|cff00b100t|cff00c500e|cff00d800n|cff00ec00c|cff00ff00y|r ## Notes: Lightweight latency monitor with color-coding for Vanilla WoW (1.12.1) ## Author: Palladinpala -## Version: 1.1 +## Version: 1.2 ## SavedVariables: OctoLatencyDB OctoLatency.xml