OSX: a window can be de-maximized by resizing

After that, QWidget::isMaximized() should return false.

Task-number: QTBUG-37703
Change-Id: Ic8b0de63ab007066cd277f511dfaa969404ff069
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Shawn Rutledge 2014-03-25 17:45:29 +01:00 committed by The Qt Project
parent 75f9c75f0a
commit 7aec099ca3
3 changed files with 17 additions and 0 deletions

View File

@ -183,6 +183,7 @@ public:
void windowWillMove(); void windowWillMove();
void windowDidMove(); void windowDidMove();
void windowDidResize(); void windowDidResize();
void windowDidEndLiveResize();
bool windowShouldClose(); bool windowShouldClose();
bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const; bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const;

View File

@ -1165,6 +1165,14 @@ void QCocoaWindow::windowDidResize()
[m_qtView updateGeometry]; [m_qtView updateGeometry];
} }
void QCocoaWindow::windowDidEndLiveResize()
{
if (m_synchedWindowState == Qt::WindowMaximized && ![m_nsWindow isZoomed]) {
m_effectivelyMaximized = false;
[m_qtView notifyWindowStateChanged:Qt::WindowNoState];
}
}
bool QCocoaWindow::windowShouldClose() bool QCocoaWindow::windowShouldClose()
{ {
bool accepted = false; bool accepted = false;

View File

@ -75,6 +75,14 @@
} }
} }
- (void)windowDidEndLiveResize:(NSNotification *)notification
{
Q_UNUSED(notification);
if (m_cocoaWindow) {
m_cocoaWindow->windowDidEndLiveResize();
}
}
- (void)windowWillMove:(NSNotification *)notification - (void)windowWillMove:(NSNotification *)notification
{ {
Q_UNUSED(notification); Q_UNUSED(notification);