From 16929c26f7a6416bf252099fafcc8615ec5f09cb Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 9 Mar 2023 14:34:16 +0000 Subject: [PATCH] OpenGLContext: Avoid calling NSView::window from displaylink thread --- modules/juce_opengl/opengl/juce_OpenGLContext.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp index 2a24efccb7..6d5b5028d0 100644 --- a/modules/juce_opengl/opengl/juce_OpenGLContext.cpp +++ b/modules/juce_opengl/opengl/juce_OpenGLContext.cpp @@ -937,11 +937,8 @@ public: { return [this, display] { - if (auto* view = nativeContext->getNSView()) - if (auto* window = [view window]) - if (auto* screen = [window screen]) - if (display == ScopedDisplayLink::getDisplayIdForScreen (screen)) - triggerRepaint(); + if (display == lastDisplay) + triggerRepaint(); }; })); }