From c1405e0d3a8c48cdf07e5553ad96053f3ccb901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Capello?= Date: Tue, 5 Nov 2024 11:17:56 -0300 Subject: [PATCH] Revert wrapping MouseEnter/Leave messages Changes reverted to fix #4754 --- src/ui/manager.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/src/ui/manager.cpp b/src/ui/manager.cpp index ab240cb04..444b00452 100644 --- a/src/ui/manager.cpp +++ b/src/ui/manager.cpp @@ -488,34 +488,27 @@ void Manager::generateMessagesFromOSEvents() } case os::Event::MouseEnter: { - auto msg = new CallbackMessage([osEvent, display]{ - if (get_multiple_displays()) { - if (osEvent.window()) { - ASSERT(display != nullptr); - _internal_set_mouse_display(display); - } + if (get_multiple_displays()) { + if (osEvent.window()) { + ASSERT(display != nullptr); + _internal_set_mouse_display(display); } - set_mouse_cursor(kArrowCursor); - mouse_display = display; - }); - msg->setRecipient(this); - enqueueMessage(msg); + } + set_mouse_cursor(kArrowCursor); + mouse_display = display; + lastMouseMoveEvent = osEvent; break; } case os::Event::MouseLeave: { - auto msg = new CallbackMessage([this, display]{ - if (mouse_display == display) { - set_mouse_cursor(kOutsideDisplay); - setMouse(nullptr); + if (mouse_display == display) { + set_mouse_cursor(kOutsideDisplay); + setMouse(nullptr); - _internal_no_mouse_position(); - mouse_display = nullptr; - } - }); - msg->setRecipient(this); - enqueueMessage(msg); + _internal_no_mouse_position(); + mouse_display = nullptr; + } // To avoid calling kSetCursorMessage when the mouse leaves // the window.