From 794c7c77f28bb530db017cc25a5e33e00933253b Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Tue, 3 Aug 2010 13:36:22 +0200 Subject: Fix the issue of resizing a window with the raster engine on Mac OS X. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcocoaview_mac.mm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 5780ebc..3229e71 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -532,9 +532,23 @@ static int qCocoaViewCount = 0; if (!qwidget) return; + // We use a different graphics system. if (QApplicationPrivate::graphicsSystem() != 0) { - qwidget->update(qwidget->rect()); - qwidgetprivate->syncBackingStore(qwidget->rect()); + + // Qt handles the painting occuring inside the window. + // Cocoa also keeps track of all widgets as NSView and therefore might + // ask for a repainting of a widget even if Qt is already taking care of it. + // + // The only valid reason for Cocoa to call drawRect: is for window manipulation + // (ie. resize, ...). + // + // Qt will then forward the update to the children. + if (qwidget->isWindow()) { + qwidget->update(qwidget->rect()); + qwidgetprivate->syncBackingStore(qwidget->rect()); + } + + // Since we don't want to use the native engine, we must exit. return; } -- cgit v0.12