From bf23091e6b29a5ca0875ca281ed346c8493b9396 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 26 Mar 2015 11:24:07 +0100 Subject: [PATCH] Cocoa integration - invalid window state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QCocoaWindow::syncWindowState incorrectly sets m_effectivelyMaximized as !m_effectivelyMaximized after calling zoom. But zoom can trigger windowDidEndLiveResize, which also can set m_effectivelyMaximized, so double negation results in ... the previous value. Fixed. Change-Id: Iea974132a1854a258e27635e8779d7d8c02bfc0c Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ec289aba99c..8ee21b121b1 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1510,10 +1510,11 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState) } } + const bool effMax = m_effectivelyMaximized; if ((m_synchedWindowState & Qt::WindowMaximized) != (newState & Qt::WindowMaximized) || (m_effectivelyMaximized && newState == Qt::WindowNoState)) { if ((m_synchedWindowState & Qt::WindowFullScreen) == (newState & Qt::WindowFullScreen)) { [m_nsWindow zoom : m_nsWindow]; // toggles - m_effectivelyMaximized = !m_effectivelyMaximized; + m_effectivelyMaximized = !effMax; } else if (!(newState & Qt::WindowMaximized)) { // it would be nice to change the target geometry that toggleFullScreen will animate toward // but there is no known way, so the maximized state is not possible at this time