I use GetMouseFocus() to determine whether the mouse is still hovering above the chat.
First I check for names or links. If you hover over one of those f.messageInfo exists.
Next I check if the frame, its parent or grandparent is in my list of frames that are part of the chat (Chatframe1, ChatFrame1Tab, GeneralDockManager ... )
This list is created in the init() function.
If one of those checks is true I know I'm still hovering the chat and I don't have to call my FadeOut function.
Lua Code:
local f = GetMouseFocus()
if f then
if f.messageInfo then
return nil
end
if hcic:IsInArray(self.Frames, f) then
return nil
end
if f:GetParent() then
f = f:GetParent()
if hcic:IsInArray(self.Frames, f) then
return nil
end
if f:GetParent() then
f = f:GetParent()
if hcic:IsInArray(self.Frames, f) then
return nil
end
end
end
end