src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h	Thu Apr 08 14:19:33 2010 +0300
@@ -51,6 +51,9 @@
  NSPanel, while QCocoaWindow needs to inherit NSWindow rather than NSPanel).
 ****************************************************************************/
 
+// WARNING: Don't include any header files from within this file. Put them
+// directly into qcocoawindow_mac_p.h and qcocoapanel_mac_p.h
+
 QT_BEGIN_NAMESPACE
 extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm
 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp
@@ -185,3 +188,20 @@
     return [super frameViewClassForStyleMask:styleMask];
 }
 
+- (void)displayIfNeeded
+{
+
+    QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self];
+    if (qwidget == 0) {
+        [super displayIfNeeded];
+        return;
+    }
+
+    if (QApplicationPrivate::graphicsSystem() != 0) {
+        if (QWidgetBackingStore *bs = qt_widget_private(qwidget)->maybeBackingStore())
+            bs->sync(qwidget, qwidget->rect());
+    }
+    [super displayIfNeeded];
+}
+
+