diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-04-15 11:34:09 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-04-15 22:01:02 (GMT) |
commit | c076d7b1ef32f53ca871cc80e16c742dff9f3b09 (patch) | |
tree | 2d48f8b0a1581f1b4a40a633f8e7608be29762b0 | |
parent | cd21a97b85f9dfea2589961de1ca24f77b3a1dd9 (diff) | |
download | Qt-c076d7b1ef32f53ca871cc80e16c742dff9f3b09.zip Qt-c076d7b1ef32f53ca871cc80e16c742dff9f3b09.tar.gz Qt-c076d7b1ef32f53ca871cc80e16c742dff9f3b09.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
(cherry picked from commit b646787cf0d67f4df00212f62a83432c641eae95)
-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 cc7d9a7..ad42efb 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); |