From 2f76a30ee18b5a7938e0c7a7be0a816f139fbc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 18 Feb 2014 07:52:32 +0100 Subject: Cocoa: Prevent "Invalid Drawable" GL warnings. Worst case this can cause the various OpenGL initialization functions to fail due to the lack of a valid GL context. Task-number: QTBUG-35342 Task-number: QTBUG-31451 Change-Id: I08256ad51acb5370c8c6d44b556572eadd6a9c1d Reviewed-by: Sean Harmer --- src/plugins/platforms/cocoa/qcocoawindow.mm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d972782f31..07b4100d4a 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1153,6 +1153,10 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow) // Child windows have no NSWindow, link the NSViews instead. [m_parentCocoaWindow->m_contentView addSubview : m_contentView]; QRect rect = window()->geometry(); + // Prevent setting a (0,0) window size; causes opengl context + // "Invalid Drawable" warnings. + if (rect.isNull()) + rect.setSize(QSize(1, 1)); NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()); [m_contentView setFrame:frame]; [m_contentView setHidden: YES]; -- cgit v1.2.3