Skip to content

Commit

Permalink
Revert wrapping MouseEnter/Leave messages
Browse files Browse the repository at this point in the history
Changes reverted to fix aseprite#4754
  • Loading branch information
martincapello authored and dacap committed Nov 6, 2024
1 parent cadd766 commit c1405e0
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions src/ui/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c1405e0

Please sign in to comment.