Please consider the attached example. When I create a PopupMenu with CustomComponents, and use PopupMenu::Options::withParentComponent, clicking (tapping) items in the menu always gives the result 0. I’m using JUCE 5.4.3 commit ccbcc41b.
If I use non-custom menu items however, it works. Also, if I omit the withParentComponent, it works as well. It is only broken on iOS (Simulator and my iPad); on Mac it works correctly.
Hi @ed95 Thank you again for this fix I came across an issue with multi-touch. The change was to call the static getCurrentRawMousePosition() for touch sources, too. I’m not sure, but that seems to be a merged position, not separated by index/finger. In my case, it happens when playing with ≥ 2 fingers on a MidiKeyboardComponent.
I tried reverting the commit (ba0d687e) and instead added a check to setScreenPos:
void setScreenPos (Point<float> newScreenPos, Time time, bool forceUpdate)
{
if (! isDragging())
setComponentUnderMouse (findComponentAt (newScreenPos), newScreenPos, time);
if (newScreenPos != Point<float>(-1, -1) // Added this check
&& (newScreenPos != lastScreenPos || forceUpdate))
{
cancelPendingUpdate();
lastScreenPos = newScreenPos;
// ...
This way, if it receives {-1, -1} from the Peer, it doesn’t save that as the lastScreenPos. This seems to solve my original PopupMenu issue, while also keeping multi-touch working.
I hope that this doesn’t break anything else, but I’m not 100% sure because I’m not familiar with all the internals there.