diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-04-15 11:34:09 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-04-15 16:14:19 (GMT) |
commit | a1905a8050432ea35ac20ffc615c4fe430f62183 (patch) | |
tree | 685bec96c6b1a589761bbb4b9ad53bfd27a11244 /src/opengl | |
parent | d02f862d2ff106517c2ad3fab6d6f089dbd9f367 (diff) | |
download | Qt-a1905a8050432ea35ac20ffc615c4fe430f62183.zip Qt-a1905a8050432ea35ac20ffc615c4fe430f62183.tar.gz Qt-a1905a8050432ea35ac20ffc615c4fe430f62183.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')
-rw-r--r-- | src/opengl/qgl_mac.mm | 2 |
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); |