Cocoa: Amend 5d07a4d944 to avoid an assert in QWidget::mapTo()

For now, we only call 'flushWindowSystemEvents()' for top-level
QWindows.

Change-Id: Ie6f6d3f9b70241820d9c38bcc0caf832d521268b
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-05-23 16:35:58 +02:00 committed by The Qt Project
parent 964be00403
commit 47a7628023

View File

@ -320,9 +320,10 @@ void QCocoaWindow::setVisible(bool visible)
// - QNSViews for child windows are initialy not hidden and won't get the
// viewDidUnhide message.
exposeWindow();
QWindowSystemInterface::flushWindowSystemEvents();
if (m_nsWindow) {
QWindowSystemInterface::flushWindowSystemEvents();
// setWindowState might have been called while the window was hidden and
// will not change the NSWindow state in that case. Sync up here:
syncWindowState(window()->windowState());