From 2d887df71c757ba4728de6d522d54c19c1b6c615 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Tue, 27 Oct 2026 10:19:15 -0500 Subject: [PATCH] fix(compat): stop Outfitter's minimap button acting as if dragged Outfitter never initializes OutfitterMinimapButton.IsDragging, so a read before the first drag falls through to the region:IsDragging() method and is truthy. Its update frame then calls UpdateDragPosition every frame with an unset CursorStartX. Set the field to false on load. --- AddOns/!!!ClassicAPI/Util/AddOnCompat.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/AddOns/!!!ClassicAPI/Util/AddOnCompat.lua b/AddOns/!!!ClassicAPI/Util/AddOnCompat.lua index 4eaac6bf..7c05e707 100644 --- a/AddOns/!!!ClassicAPI/Util/AddOnCompat.lua +++ b/AddOns/!!!ClassicAPI/Util/AddOnCompat.lua @@ -274,3 +274,23 @@ EventRegistry:RegisterFrameEventAndCallback("ADDON_LOADED", CAPI_ApplyStandardColorGlobals) EventRegistry:RegisterFrameEventAndCallback("PLAYER_LOGIN", CAPI_ApplyStandardColorGlobals) + +-- Outfitter keeps its minimap button's drag state in a plain field, +-- `OutfitterMinimapButton.IsDragging`, that it never initializes: the field is +-- nil until the first OnDragStart, and OutfitterTimer_AdjustTimer and +-- OutfitterUpdateFrame_OnUpdate read it as a boolean before then. Our DLL adds +-- the `region:IsDragging()` method, so a read that misses the raw field now +-- falls through the metatable to that function, which is truthy. Outfitter +-- then believes a drag is in progress from the moment it loads: its update +-- frame calls UpdateDragPosition every frame, which subtracts a CursorStartX +-- that only OnMouseDown sets (Outfitter.lua:5235). A real drag would assign +-- the field and mask the method, but pfUI's addon-buttons module clears +-- OnDragStart on the minimap buttons it collects, so that may never happen. +-- Give the field vanilla's falsy value before the first OnUpdate can run. +if C_AddOns.DoesAddOnExist("Outfitter") then + EventUtil.ContinueOnAddOnLoaded("Outfitter", function() + if OutfitterMinimapButton then + OutfitterMinimapButton.IsDragging = false + end + end) +end