Prevent frame notifications going out when the content view is set
authorAndy Shaw <andy.shaw@digia.com>
Wed, 7 Nov 2012 13:46:26 +0000 (14:46 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 05:35:46 +0000 (06:35 +0100)
When the content view is set it will trigger a frame notification which
we do not want to see because it would put our internal data on the
geometry out of sync. So ignore the notification until after it is set.

Change-Id: I704c2f186c8b0c6508a90d5dab51b7f6f02162fc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/plugins/platforms/cocoa/qcocoawindow.mm

index c1c5f49..a762603 100644 (file)
@@ -717,7 +717,9 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
                                           name:nil // Get all notifications
                                           object:m_nsWindow];
 
+    [m_contentView setPostsFrameChangedNotifications: NO];
     [window setContentView:m_contentView];
+    [m_contentView setPostsFrameChangedNotifications: YES];
 }
 
 void QCocoaWindow::clearNSWindow(NSWindow *window)