Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

[[ Bug 22908 ]] Send mouseRelease to object with mouse focus #7431

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/notes/bugfix-22908.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ensure mouseRelease is sent to the mouse focused object when when triggered by a system mouse or touch cancel
8 changes: 7 additions & 1 deletion engine/src/eventqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ static void MCEventQueueDispatchEvent(MCEvent *p_event)
t_target -> mup(t_event -> mouse . press . button + 1, false);
MClockmessages = old_lock;

t_target -> message_with_args(MCM_mouse_release, t_event -> mouse . press . button + 1);
MCObject *mfocused;
mfocused = MCmousestackptr->getcard()->getmfocused();
if (mfocused == NULL)
mfocused = MCmousestackptr -> getcard();
if (mfocused == NULL)
mfocused = MCmousestackptr;
mfocused -> message_with_args(MCM_mouse_release, t_event -> mouse . press . button + 1);
}
}
break;
Expand Down