Fix MouseEnter and MouseLeave (fix #4240)

Callback messages were not being handled and since MouseEnter and
MouseLeave events were wrapped into CallbackMessages they were lost
and so never got called
This commit is contained in:
Martín Capello 2024-10-22 17:02:32 -03:00 committed by David Capello
parent 85eb64ca35
commit cbac6f98a7

View File

@ -498,6 +498,7 @@ void Manager::generateMessagesFromOSEvents()
set_mouse_cursor(kArrowCursor);
mouse_display = display;
});
msg->setRecipient(this);
enqueueMessage(msg);
lastMouseMoveEvent = osEvent;
break;
@ -513,7 +514,7 @@ void Manager::generateMessagesFromOSEvents()
mouse_display = nullptr;
}
});
msg->setRecipient(this);
enqueueMessage(msg);
// To avoid calling kSetCursorMessage when the mouse leaves
@ -1665,6 +1666,11 @@ bool Manager::onProcessMessage(Message* msg)
else
return false;
}
case kCallbackMessage: {
CallbackMessage* callback = static_cast<CallbackMessage*>(msg);
callback->call();
return true;
}
}