Cocoa integration - invalid window state

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 <morten.sorvig@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov 2015-03-26 11:24:07 +01:00
parent 8b1f01e573
commit bf23091e6b

View File

@ -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