mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-30 02:50:05 +00:00
Fixed a bug where a mouse enter event wouldn't be sent to the Component under the mouse when exiting a modal loop and where mouse exit events were being sent when a modal loop was active
This commit is contained in:
parent
06dde9d927
commit
ce14b66763
1 changed files with 14 additions and 0 deletions
|
|
@ -1755,6 +1755,13 @@ void Component::exitModalState (const int returnValue)
|
|||
ModalComponentManager& mcm = *ModalComponentManager::getInstance();
|
||||
mcm.endModal (this, returnValue);
|
||||
mcm.bringModalComponentsToFront();
|
||||
|
||||
// If the mouse is over another Component when we exit the modal state then send a mouse enter event
|
||||
if (MouseInputSource* mouse = Desktop::getInstance().getMouseSource (0))
|
||||
{
|
||||
if (Component* c = mouse->getComponentUnderMouse())
|
||||
c->internalMouseEnter (*mouse, mouse->getScreenPosition(), Time::getCurrentTime());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2406,6 +2413,13 @@ void Component::internalMouseEnter (MouseInputSource source, Point<float> relati
|
|||
|
||||
void Component::internalMouseExit (MouseInputSource source, Point<float> relativePos, Time time)
|
||||
{
|
||||
if (isCurrentlyBlockedByAnotherModalComponent())
|
||||
{
|
||||
// if something else is modal, always just show a normal mouse cursor
|
||||
source.showMouseCursor (MouseCursor::NormalCursor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags.repaintOnMouseActivityFlag)
|
||||
repaint();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue