1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windows touch with CallOutBox bug fix

This commit is contained in:
ed 2016-08-11 11:02:04 +01:00
parent c7b347242d
commit cbdf707116
3 changed files with 24 additions and 4 deletions

View file

@ -41,7 +41,11 @@ CallOutBox::CallOutBox (Component& c, const Rectangle<int>& area, Component* con
.getDisplayContaining (area.getCentre()).userArea);
addToDesktop (ComponentPeer::windowIsTemporary);
startTimer (100);
}
creationTime = Time::getCurrentTime();
}
CallOutBox::~CallOutBox()
@ -129,7 +133,14 @@ void CallOutBox::inputAttemptWhenModal()
// if you click on the area that originally popped-up the callout, you expect it
// to get rid of the box, but deleting the box here allows the click to pass through and
// probably re-trigger it, so we need to dismiss the box asynchronously to consume the click..
dismiss();
// For touchscreens, we make sure not to dismiss the CallOutBox immediately,
// as Windows still sends touch events before the CallOutBox had a chance
// to really open.
RelativeTime elapsed = Time::getCurrentTime() - creationTime;
if (elapsed.inMilliseconds() > 200)
dismiss();
}
else
{
@ -240,3 +251,9 @@ void CallOutBox::refreshPath()
targetPoint - getPosition().toFloat(),
9.0f, arrowSize * 0.7f);
}
void CallOutBox::timerCallback()
{
toFront (true);
stopTimer();
}