From be8a8c26b5e918bc2d8305025445c206e31f75a3 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:00:01 -0500 Subject: [PATCH] Replace the row hover poll with OnLeave handlers The gear button sits inside the set row's rectangle, so MouseIsOver(row) is true for both. Show the gear on row enter. Hide it from a shared OnLeave on the row and the gear when the cursor leaves the row. This removes the per-frame OnUpdate poll. --- modules/equipmentmanager.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/equipmentmanager.lua b/modules/equipmentmanager.lua index 137e32f9..c6d62315 100644 --- a/modules/equipmentmanager.lua +++ b/modules/equipmentmanager.lua @@ -300,27 +300,27 @@ pfUI:RegisterModule("equipmentmanager", function() pfUI.equipmentmanager.Refresh() end) - -- Hover handling: OnLeave fires when the cursor moves onto a child - -- (the gear button becomes the topmost mouse target). Use an - -- OnUpdate poll so the gear stays shown while the cursor is over - -- the row OR the gear itself. + -- Show the gear and tooltip while the cursor is over the row or its + -- gear child. The gear sits inside the row's rectangle, so a single + -- MouseIsOver(row) check covers both. OnLeave on the row and the gear + -- catches every exit path, so no OnUpdate poll is needed. + local function HideRowHover() + if MouseIsOver(row) then return end + GameTooltip:Hide() + row.gear:Hide() + end row:SetScript("OnEnter", function() - if not this.setID then return end - local name = C_EquipmentSet.GetEquipmentSetInfo(this.setID) + if not row.setID then return end + local name = C_EquipmentSet.GetEquipmentSetInfo(row.setID) if name then - GameTooltip:SetOwner(this, "ANCHOR_RIGHT") + GameTooltip:SetOwner(row, "ANCHOR_RIGHT") GameTooltip:SetEquipmentSet(name) GameTooltip:Show() end row.gear:Show() - this:SetScript("OnUpdate", function() - if not MouseIsOver(this) and not MouseIsOver(row.gear) then - this:SetScript("OnUpdate", nil) - GameTooltip:Hide() - row.gear:Hide() - end - end) end) + row:SetScript("OnLeave", HideRowHover) + row.gear:SetScript("OnLeave", HideRowHover) return row end