Fix drag getting stuck to cursor on release, bump to 1.2

OnMouseUp only fires while the cursor is still over the frame at the
instant the button is released, which a quick flick of this small
frame easily misses, leaving it stuck following the mouse forever.
OnUpdate now polls IsMouseButtonDown every frame and stops the drag
as soon as the button is released, independent of cursor position.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kompolompo
2026-09-05 12:31:35 +02:00
co-authored by Claude Sonnet 5
parent 36be1e9d8e
commit 5e1f373b75
3 changed files with 14 additions and 1 deletions
+4
View File
@@ -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).
+9
View File
@@ -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
+1 -1
View File
@@ -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