Browse Source

Some workarounds to avoid triggering the new Xcode thread checker when using openGL

tags/2021-05-28
jules 8 years ago
parent
commit
25fe3ee392
2 changed files with 14 additions and 9 deletions
  1. +10
    -6
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm
  2. +4
    -3
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 10
- 6
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -371,12 +371,7 @@ public:
bool isKioskMode() const override
{
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (hasNativeTitleBar() && ([window styleMask] & NSWindowStyleMaskFullScreen) != 0)
return true;
#endif
return ComponentPeer::isKioskMode();
return isWindowInKioskMode || ComponentPeer::isKioskMode();
}
static bool isWindowAtPoint (NSWindow* w, NSPoint screenPoint)
@@ -441,10 +436,18 @@ public:
{
if (hasNativeTitleBar())
{
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
isWindowInKioskMode = (([window styleMask] & NSWindowStyleMaskFullScreen) != 0);
#endif
auto screen = getFrameSize().subtractedFrom (component.getParentMonitorArea());
fullScreen = component.getScreenBounds().expanded (2, 2).contains (screen);
}
else
{
isWindowInKioskMode = false;
}
}
bool hasNativeTitleBar() const
@@ -1353,6 +1356,7 @@ public:
NSWindow* window = nil;
NSView* view = nil;
bool isSharedWindow = false, fullScreen = false;
bool isWindowInKioskMode = false;
#if USE_COREGRAPHICS_RENDERING
bool usingCoreGraphics = true;
#else


+ 4
- 3
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -143,7 +143,10 @@ public:
}
//==============================================================================
void paint (Graphics&) override {}
void paint (Graphics&) override
{
updateViewportSize (false);
}
bool invalidateAll() override
{
@@ -229,8 +232,6 @@ public:
if (shouldExit())
return false;
updateViewportSize (false);
}
if (! context.makeActive())


Loading…
Cancel
Save