macOS: Remove workaround for zero-size GL views

This is no longer a problem, and this condition should be
handled by QCocoaGLContext in any case.

Change-Id: Iaac9d1a8962b27bf6f0394b8c1ea3e46dc28e29e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-07-21 14:42:05 +02:00
parent 8b60ebf93a
commit 7284384eda

View File

@ -1511,15 +1511,8 @@ void QCocoaWindow::recreateWindowIfNeeded()
setWindowFilePath(window()->filePath()); // Also sets window icon
setWindowState(window()->windowState());
} else {
// Child windows have no NSWindow, link the NSViews instead.
// Child windows have no NSWindow, re-parent to superview instead
[parentCocoaWindow->m_view addSubview:m_view];
QRect rect = windowGeometry();
// 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_view setFrame:frame];
[m_view setHidden:!window()->isVisible()];
}