summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_mac.mm
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-04-15 11:34:09 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-04-15 11:37:05 (GMT)
commitb646787cf0d67f4df00212f62a83432c641eae95 (patch)
tree7cfc9e887f3f267c0b92db354a5b44fbaeaf5423 /src/opengl/qgl_mac.mm
parentd7e8586e6ab009a6da1eb63aa6798d7c6a34c30d (diff)
downloadQt-b646787cf0d67f4df00212f62a83432c641eae95.zip
Qt-b646787cf0d67f4df00212f62a83432c641eae95.tar.gz
Qt-b646787cf0d67f4df00212f62a83432c641eae95.tar.bz2
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/qgl_mac.mm')
-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 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<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);