From 5501f9a946bfb27a012795dca6bfca2fffbe3e0c Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 17 May 2016 21:22:54 +0300 Subject: [PATCH] 0027510: Visualization, OpenGl_Window - do not ignore backing store resize on OS X --- src/OpenGl/OpenGl_Window_1.mm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/OpenGl/OpenGl_Window_1.mm b/src/OpenGl/OpenGl_Window_1.mm index c2b02b2b7d..0b3c6dd512 100644 --- a/src/OpenGl/OpenGl_Window_1.mm +++ b/src/OpenGl/OpenGl_Window_1.mm @@ -255,7 +255,25 @@ void OpenGl_Window::Resize() if (myWidthPt == aWidthPt && myHeightPt == aHeightPt) { + #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE return; + #else + // check backing store change (moving to another screen) + NSOpenGLContext* aGLCtx = myGlContext->myGContext; + NSView* aView = [aGLCtx view]; + if (![aView respondsToSelector: @selector(convertSizeToBacking:)]) + { + return; + } + + NSRect aBounds = [aView bounds]; + NSSize aRes = [aView convertSizeToBacking: aBounds.size]; + if (myWidth == Standard_Integer(aRes.width) + && myHeight == Standard_Integer(aRes.height)) + { + return; + } + #endif } myWidthPt = aWidthPt; -- 2.20.1