summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2010-08-03 11:36:22 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2010-08-03 11:36:41 (GMT)
commit794c7c77f28bb530db017cc25a5e33e00933253b (patch)
treef26b48a5c03e22fe96cdbf50f93fefb4c202e594 /src/gui/kernel/qcocoaview_mac.mm
parent7fb31670f080c224249279c35240a8eb95f8d877 (diff)
downloadQt-794c7c77f28bb530db017cc25a5e33e00933253b.zip
Qt-794c7c77f28bb530db017cc25a5e33e00933253b.tar.gz
Qt-794c7c77f28bb530db017cc25a5e33e00933253b.tar.bz2
Fix the issue of resizing a window with the
raster engine on Mac OS X. Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm18
1 files 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;
}