Other mouse functions such as mouseDown are working as I would expect them to.
To test mouseMagnify I’m holding the mouse over the given component and then pinch-zooming on my trackpad, and nothing happens. I’ve also tested to make sure that the component has keyboard focus, and it does.
Obviously the message is being lost somewhere upstream, but I don’t know where to look.
I’ve just run into the same problem on macOS 10.13.6
All other mouse methods are being fired, but mouseMagnify never gets called when performing a pinch gesture over the component I have overridden it for.
Can reproduce by starting a new Plugin from Projucer, adding
You’ll have to dig into it unfortunately. The flow that leads to that function goes through the generic handleMagnifyGesture function, and prior to that, on macOS it goes through magnify which is supposed to be triggered by magnifyWithEvent.
I put a breakpoint at line 97 of juce_ComponentPeer.cpp:
void ComponentPeer::handleMagnifyGesture (MouseInputSource::InputSourceType type, Point<float> pos, int64 time, float scaleFactor, int touchIndex)
{
if (auto* mouse = Desktop::getInstance().mouseSources->getOrCreateMouseInputSource (type, touchIndex))
MouseInputSource (*mouse).handleMagnifyGesture (*this, pos, time, scaleFactor);
}
But it never breaks when I pinch-zoom on my trackpad.
Then I followed the call hierarchy all the way back to line 3395 in juce_win32_Windowing.cpp:
static LRESULT CALLBACK windowProc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
{
// Ensure that non-client areas are scaled for per-monitor DPI awareness v1 - can't
// do this in peerWindowProc as we have no window at this point
if (message == WM_NCCREATE && enableNonClientDPIScaling != nullptr)
enableNonClientDPIScaling (h);
if (auto* peer = getOwnerOfWindow (h))
{
jassert (isValidPeer (peer));
return peer->peerWindowProc (h, message, wParam, lParam);
}
return DefWindowProcW (h, message, wParam, lParam);
}
I put a breakpoint here, with condition “message == 0x119”. (windowProc() breaks all the time, but as far as I can tell, “message == 0x119” is the condition that should lead to handleMagnifyGesture () being called). But this breakpoint is also never reached. Visual Studio can’t find any higher results than windowProc() on the call hierarchy, so I’m stuck.
I’m still dead in the water because of this problem. Can anyone help? It seems possible that the problem is not with JUCE but on some other level on my laptop, but I really have no idea where to begin searching.
This seems to be a JUCE issue - my mouseMagnify handler works flawlessly on a Macbook, but doesn’t get called when doing a zoom gesture on a Windows Laptop’s trackpad. Other applications on that laptop do allow me to zoom via gesture, but JUCE just treats it like scrolling.