From 29e6bee01fd307c6cd443c38061ecb25540e1acb Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 19 Dec 2024 22:58:16 +0000 Subject: [PATCH] OpenGL: Fix mouse-move handling for OpenGL views Since b108fe26c3c81de6c84f5a1a79e750589fc0b8dd, JUCE NSViews have ignored mouse movements for child views. However, this causes issues for OpenGL views, which still expect to receive mouse input via the parent view. This fix makes the inner OpenGL view effectively invisible to the mouse, so all mouse events are handled by the owning JUCE view. --- modules/juce_opengl/native/juce_OpenGL_mac.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_opengl/native/juce_OpenGL_mac.h b/modules/juce_opengl/native/juce_OpenGL_mac.h index c3bf44fced..1a856e7df6 100644 --- a/modules/juce_opengl/native/juce_OpenGL_mac.h +++ b/modules/juce_opengl/native/juce_OpenGL_mac.h @@ -328,6 +328,11 @@ public: return [[(NSOpenGLView*) self superview] accessibilityHitTest: p]; }); + addMethod (@selector (hitTest:), [] (id, SEL, NSPoint) -> NSView* + { + return nil; + }); + registerClass(); } };