summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-04-15 13:34:09 +0200
committerTrond Kjernåsen <trond@trolltech.com>2009-04-15 13:37:05 +0200
commitb646787cf0d67f4df00212f62a83432c641eae95 (patch)
tree7cfc9e887f3f267c0b92db354a5b44fbaeaf5423 /src/opengl
parentd7e8586e6ab009a6da1eb63aa6798d7c6a34c30d (diff)
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
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/qgl_mac.mm b/src/opengl/qgl_mac.mm
index 3dbdaecdc6..13193962c4 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<NSOpenGLContext *>(d->cx) view] != view)
+ if ([static_cast<NSOpenGLContext *>(d->cx) view] != view && ![view isHidden])
[static_cast<NSOpenGLContext *>(d->cx) setView:view];
} else if (d->paintDevice->devType() == QInternal::Pixmap) {
const QPixmap *pm = static_cast<const QPixmap *>(d->paintDevice);