Mouse clicks offset for OpenGL when window size is too small

opengl

#1

In REAPER, if the plugin window size is too small, mouse clicks are offset. This happens for OpenGL rendering but not for CoreGraphics.

This situation can also happen to our users if they choose a window size that is too big to fit on their display.

I’ve made an example using the JUCE plugin example code, built off of my example project for a previous question. You can see it on the openGL_offset branch here. That example is shown in the gif above.


#2

I’ve had a look at this. This is really hard to fix for us as REAPER is not moving or re-sizing the editor inside of the host’s parent view. It seems to move the parent view to a clipped region of the window and JUCE is not getting any callbacks that this is going on.

As JUCE overlays the OpenGL view on top of the real editor, we have no chance to re-position the OpenGL overlay.

The real fix would be for the VST to return an OpenGL view as it’s editor directly instead of returning an NSView with an OpenGL view overlay tracking the movements of the editor.

This is something we wanted to fix for a long time in JUCE: allowing component peers to be OpenGL views directly. There used to be some messagemanager synchronisation problems which stopped us from doing this but with the OpenGLContext::executeOnGlThread this should now be possible for us to do. But it’s not an easy task. I’ll need to discuss this with the team.


#3

Thanks for your quick reply! Glad you’re aware of the issue, we’re looking forward to hearing what the JUCE team decides to do on this.