summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaglcontext.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2012-11-26 15:47:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-28 21:09:42 +0100
commitbb38d1b1d527b70aa2ca8d50a6a703d2faa5b8a0 (patch)
tree43e1bcf2c833b74d5fe18f525ba20b1688debd0a /src/plugins/platforms/cocoa/qcocoaglcontext.mm
parenta0d379bc9a76dfcce08c69abb30d1fea821fd7d7 (diff)
Cocoa: update OpenGL viewport when nsview moves
NSOpenGLContext expexts an -update call whenever the physical position of the view it draws to changes on screen. Since we don't get geometry callbacks for such views when the parent view moves, we need to register a special notification for that case, and tell Qt that we need to repaint the QWindow that the view is backing. This case does not hit very often, but is evident in MDI applications where the subwindows are OpenGL backed QGraphicsView widgets. Dragging the subwindows around produces garbage inside the windows. Change-Id: I1b162470b03cca6ed722c6c54080459f2c5e91d9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 4e11f55b0a..d9bb9c60a9 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -113,8 +113,7 @@ void QCocoaGLContext::setActiveWindow(QWindow *window)
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
cocoaWindow->setCurrentContext(this);
- NSView *view = cocoaWindow->contentView();
- [m_context setView:view];
+ [(QNSView *) cocoaWindow->contentView() setQCocoaGLContext:this];
}
void QCocoaGLContext::doneCurrent()