Questie

Questie

116M Downloads

QuestieEventHandler.lua calls LibDropDown.CloseDropDownMenus on every CURSOR_UPDATE

Duugu opened this issue ยท 0 comments

commented

https://github.com/Questie/Questie/blob/master/Modules/QuestieEventHandler.lua#L130

-- dropdown fix
        Questie:RegisterEvent("CURSOR_UPDATE", function() pcall(LibDropDown.CloseDropDownMenus) end)

That leads to a lot of calls of LibDropDown.CloseDropDownMenus.
Unfortunately LibDropDown is not checking if a dropdown is visible. It's just hiding all dropdowns:

function lib:CloseDropDownMenus(level)
    if ( not level ) then
        level = 1;
    end
    for i=level, L_UIDROPDOWNMENU_MAXLEVELS do
        _G["L_DropDownList"..i]:Hide();
    end
    -- yes, we also want to close the menus which created by built-in UIDropDownMenus
    for i=level, UIDROPDOWNMENU_MAXLEVELS do
        _G["DropDownList"..i]:Hide();
    end
end

Together with the call of CloseDropDownMenus on each CURSOR_UPDATE by Questie that leads to massive spam of Hide calls and "OnHide" events for all dropdown widgets.

That is not only unecessary, but it also interferes with every addon that is hooking :Hide

Could you please replace your code by this, to avoid that spam?

Questie:RegisterEvent("CURSOR_UPDATE", function() 
    for i=1, L_UIDROPDOWNMENU_MAXLEVELS do
        if _G["L_DropDownList"..i]:IsVisible() then
            _G["L_DropDownList"..i]:Hide()
        end
        if _G["DropDownList"..i]:IsVisible() then
            _G["DropDownList"..i]:Hide()
        end
    end
end)

Thanks a million! :)