BLUF: MasterLooterFrame has an anchor issue when right-clicking player-placed frames.
I have a guild mate who often runs as the master looter and likes to assign raid target markers via the right-click context menu. He has complained about always having to reload his UI every time he ML’d an item before he could set raid targets again. Today I looked into this issue for him and realized I could reproduce it, even after disabling all of my addons.
The error received when right-clicking on the target frame after ML’ing an item:
Message: Interface\FrameXML\UIDropDownMenu.lua:1084: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: DropDownList1:SetPoint.
Time: Sat Jun 26 14:17:51 2021
Count: 17
Stack: Interface\FrameXML\UIDropDownMenu.lua:1084: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: DropDownList1:SetPoint.
[string "=[C]"]: ?
[string "=[C]"]: in function `SetPoint'
[string "@Interface\FrameXML\UIDropDownMenu.lua"]:1084: in function <Interface\FrameXML\UIDropDownMenu.lua:975>
[string "=[C]"]: in function `ToggleDropDownMenu'
[string "@Interface\FrameXML\SecureTemplates.lua"]:306: in function `handler'
[string "@Interface\FrameXML\SecureTemplates.lua"]:616: in function `SecureActionButton_OnClick'
[string "@Interface\FrameXML\SecureTemplates.lua"]:656: in function <Interface\FrameXML\SecureTemplates.lua:648>
Locals:
“SetPoint would result in anchor family connection” was not a whole lot to go off of, but doing a Google search for the error message brought up several other posts about the MoveAnything addon. As I didn’t use this addon (and as far as I know, neither did my guild mate), this led me to think about if it was tied my target frame being moved. I reset my target frame to its default position and tried again. No error message, but I was able to notice some odd behavior of the ML frame – when it was left opened, it followed around the drop down context menu when I clicked on other UI elements such as the target unit frame or the chat box header.
I opened up Blizzard’s UI code and saw on line 598 of LootFrame.lua that the MasterLooterFrame gets anchored to DropDownList1, explaining why the frame follows the drop down list around. However, this anchor is never removed, even when the MasterLootFrame is hidden. As the MasterLooterFrame seems to have issues on user-placed frames, I concluded it was still causing the problem even after loot was assigned and the frame was hidden.
I quickly wrote up a one-line addon to clear that anchor point whenever the ML frame had its Hide function called. This seemed to avoid the error, even after putting my target unit frame back into its custom position. It worked for my guild mate too.
Entire code block of addon:
hooksecurefunc(MasterLooterFrame, 'Hide', function(self) self:ClearAllPoints() end)
Ideally I’d like to see a fix where the ML window doesn’t follow the drop down menu around (clicking on non-loot should close the ML window, maybe?), but at the very least the default UI shouldn’t be able to get into an error state like it can now.
Thanks for looking into this, Blizz!
