From 8aa1831d3c74593db97ce48ae7d8bd0c809d82fa Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 9 Nov 2015 16:01:32 +0000 Subject: [PATCH] Fix for exceptions in OSX pressure detection when WebKit views are used. --- .../native/juce_mac_NSViewComponentPeer.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index d59f039241..096bb8f0f3 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -1090,7 +1090,15 @@ public: static float getMousePressure (NSEvent* e) noexcept { - return (float) e.pressure; + @try + { + if (e.type != NSMouseEntered && e.type != NSMouseExited) + return (float) e.pressure; + } + @catch (NSException* e) {} + @finally {} + + return 0.0f; } static Point getMousePos (NSEvent* e, NSView* view)