GetMouseFocus replaced by GetMouseFoci #21


  • Defect
Open
  • xam_insight created this issue Jul 5, 2024

    Hello!

     

    As documented here, the GetMouseFocus will be replaced by GetMouseFoci in TWW but it works a little different.

    On TWW test servers, the usage of GetMouseFocus causes null errors.

     

    Here is the fix found by Kharthus on the addon ItemRack.

     

    if tocversion >= 110000 then
    	local region = GetMouseFoci()
    	local frame = region[1]
    else
    	local frame = GetMouseFocus()
    end

     

    Regards :)

  • xam_insight added a tag Defect Jul 5, 2024
  • xam_insight posted a comment Jul 5, 2024

    I suggest this fix on line 118 of LibUIDropDownMenu.lua but I cannot test it as the test servers are down at the moment.

     

     

    function lib:UIDropDownMenuButton_ShouldShowIconTooltip(self)
    	if self.Icon and (self.iconTooltipTitle or self.iconTooltipText) and (self.icon or self.mouseOverIcon) then
    		if wowversion >= 110000 then
    			local region = GetMouseFoci()
    			local frame = region[1]
    		else
    			local frame = GetMouseFocus()
    		end
    		return frame == self.Icon;
    	end
    	return false;
    end

     


    Edited Jul 13, 2024
  • xam_insight posted a comment Jul 12, 2024

    PTR still not open in my region. Unable to test the fix :/

  • xam_insight posted a comment Jul 13, 2024

    Servers are up.

    I replace tocversion by wowversion above ;)


    Edited Jul 13, 2024
  • xam_insight posted a comment Dec 13, 2024

    Now that Classic also use GetMouseFoci, I changed the code to:

     

    function lib:UIDropDownMenuButton_ShouldShowIconTooltip(self)
    	if self.Icon and (self.iconTooltipTitle or self.iconTooltipText) and (self.icon or self.mouseOverIcon) then
    		if GetMouseFoci then
    			local region = GetMouseFoci()
    			local frame = region[1]
    		else
    			local frame = GetMouseFocus()
    		end
    		return frame == self.Icon;
    	end
    	return false;
    end

     


    Edited Dec 13, 2024

To post a comment, please login or register a new account.