summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-04-15 12:11:39 +0200
committerNorwegian Rock Cat <qt-info@nokia.com>2009-04-15 12:17:06 +0200
commitb4234ab3f4dbd8c7017d749888b2d8effd3c5983 (patch)
tree6be863fea37b64cb9950da2274cbe6a4423ab401 /src/opengl/qgl.cpp
parenta55f477b2a40b89e690fe6b61509cf665e96243b (diff)
BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.
The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 6d75d02350..b4a0e5c909 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3234,6 +3234,10 @@ bool QGLWidget::event(QEvent *e)
update();
}
return true;
+# if defined(QT_MAC_USE_COCOA)
+ } else if (e->type() == QEvent::MacGLClearDrawable) {
+ d->glcx->d_ptr->clearDrawable();
+# endif
}
#endif