diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-02-18 07:52:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-25 16:01:43 +0100 |
commit | 2f76a30ee18b5a7938e0c7a7be0a816f139fbc7a (patch) | |
tree | 4b74b9ebe600dd6ed3a4bcc70ce47bb99f4a56af | |
parent | 72ba4cd3858773757d3cc5a66f7859a483b6475b (diff) |
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 <sean.harmer@kdab.com>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 4 |
1 files changed, 4 insertions, 0 deletions
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]; |