From cbac6f98a7e445f5001eec7843b2b29b41a26646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Capello?= Date: Tue, 22 Oct 2024 17:02:32 -0300 Subject: [PATCH] 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 --- src/ui/manager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp index aae01bf3d..c3396db3a 100644 --- a/src/ui/manager.cpp +++ b/src/ui/manager.cpp @@ -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(msg); + callback->call(); + return true; + } }