From b646787cf0d67f4df00212f62a83432c641eae95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 15 Apr 2009 13:34:09 +0200 Subject: Reparenting QGLWidgets did sometimes caused warnings to be printed on Mac/Cocoa. Check if the view is visible before attaching it to a context. Task-number: related to 250066 Reviewed-by: Norwegian Rock Cat BT: yes --- src/opengl/qgl_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl_mac.mm b/src/opengl/qgl_mac.mm index 3dbdaec..1319396 100644 --- a/src/opengl/qgl_mac.mm +++ b/src/opengl/qgl_mac.mm @@ -629,7 +629,7 @@ void QGLContext::updatePaintDevice() // ideally we would use QWidget::isVisible(), but we get "invalid drawable" errors if (![(NSWindow *)qt_mac_window_for(w) isVisible]) return; - if ([static_cast(d->cx) view] != view) + if ([static_cast(d->cx) view] != view && ![view isHidden]) [static_cast(d->cx) setView:view]; } else if (d->paintDevice->devType() == QInternal::Pixmap) { const QPixmap *pm = static_cast(d->paintDevice); -- cgit v0.12