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>
This commit is contained in:
parent
72ba4cd385
commit
2f76a30ee1
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user