From 4ba439f78aec1caef268dba0f229b8a0242e4c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 8 Jan 2010 12:33:52 +0100 Subject: Cocoa: Fix painting errors on QGLWidget resizing. Revby: Trond We need to update the GL context syncronously during the resize to prevent flicker. Use the existing MacGLWindowChange machinery to do that. --- src/gui/kernel/qcocoaview_mac.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 9950697..c14798a 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -508,6 +508,13 @@ extern "C" { } else { [self setNeedsDisplay:YES]; } + + // Make sure the opengl context is updated on resize. + if (0 && qwidgetprivate->isGLWidget) { + qwidgetprivate->needWindowChange = true; + QEvent event(QEvent::MacGLWindowChange); + qApp->sendEvent(qwidget, &event); + } } - (void)drawRect:(NSRect)aRect -- cgit v0.12