From 85708e7377e819649fd17948a77e8a3d6077a4e8 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 19 Sep 2013 12:55:11 +0200 Subject: Revert "Fix Invalid Drawable error when using createWindowContainer on Mac." This reverts commit 04325bdd26810cd9067ad4b0b9e458b06ce2a3db. This change breaks qtdeclarative on Mac. Change-Id: I77b121cc6b283cf7498e93e4b914d2fb68808ab6 Reviewed-by: Lars Knoll --- src/plugins/platforms/cocoa/qnsview.h | 1 - src/plugins/platforms/cocoa/qnsview.mm | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index f75b3e35ca..ca2a15a1cc 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -70,7 +70,6 @@ QT_END_NAMESPACE Qt::KeyboardModifiers currentWheelModifiers; bool m_subscribesForGlobalFrameNotifications; QCocoaGLContext *m_glContext; - bool m_drawRectHasBeenCalled; bool m_shouldSetGLContextinDrawRect; } diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ea8e1b363b..b8a31329fe 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -87,7 +87,6 @@ static QTouchDevice *touchDevice = 0; m_sendKeyEvent = false; m_subscribesForGlobalFrameNotifications = false; m_glContext = 0; - m_drawRectHasBeenCalled = false; m_shouldSetGLContextinDrawRect = false; currentCustomDragTypes = 0; m_sendUpAsRightButton = false; @@ -154,9 +153,9 @@ static QTouchDevice *touchDevice = 0; - (void) setQCocoaGLContext:(QCocoaGLContext *)context { m_glContext = context; - if (m_drawRectHasBeenCalled) { - [m_glContext->nsOpenGLContext() setView:self]; - } else { + [m_glContext->nsOpenGLContext() setView:self]; + if (![m_glContext->nsOpenGLContext() view]) { + //was unable to set view m_shouldSetGLContextinDrawRect = true; } @@ -393,8 +392,6 @@ static QTouchDevice *touchDevice = 0; m_shouldSetGLContextinDrawRect = false; } - m_drawRectHasBeenCalled = true; - if (!m_backingStore) return; -- cgit v1.2.3