Cocoa: update OpenGL viewport when nsview moves
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Mon, 26 Nov 2012 14:47:02 +0000 (15:47 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 28 Nov 2012 20:09:42 +0000 (21:09 +0100)
commitbb38d1b1d527b70aa2ca8d50a6a703d2faa5b8a0
tree43e1bcf2c833b74d5fe18f525ba20b1688debd0a
parenta0d379bc9a76dfcce08c69abb30d1fea821fd7d7
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>
src/plugins/platforms/cocoa/qcocoaglcontext.mm
src/plugins/platforms/cocoa/qnsview.h
src/plugins/platforms/cocoa/qnsview.mm