summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-07-08 07:53:00 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-08 17:40:26 (GMT)
commite576779a537e5e60d1495b6d690561cce8f4cb3b (patch)
treee2195561225d7fba24f07c7b4eec06b1fd18bc02 /src/gui
parent7b7c321d5f35b6ee70db5a72d5d37e19e125d7cf (diff)
downloadQt-e576779a537e5e60d1495b6d690561cce8f4cb3b.zip
Qt-e576779a537e5e60d1495b6d690561cce8f4cb3b.tar.gz
Qt-e576779a537e5e60d1495b6d690561cce8f4cb3b.tar.bz2
Mac: Handle the maximizing of the window ourselves when it is frameless
On Mac we need to make a frameless window appear maximized manually rather than letting the underlying Cocoa API deal with it because it would overwise not appear correctly. The test is only done for Mac due to the fact that it is not giving reliable results on other platforms and the source code change is Mac specific anyway. Change-Id: Id48a67ba70bfb4bdc921256f1a80328615c98a6b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 702a56b..2fe1f06 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3866,7 +3866,14 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
d->updateFrameStrut(); // In theory the dirty would work, but it's optimized out if the window is not visible :(
}
// Everything should be handled by Cocoa.
- [window zoom:window];
+ if (!windowFlags() & Qt::FramelessWindowHint) {
+ [window zoom:window];
+ } else {
+ QDesktopWidget *dsk = QApplication::desktop();
+ QRect avail = dsk->availableGeometry(dsk->screenNumber(this));
+ setGeometry(avail);
+ }
+
#endif
needSendStateChange = oldstate == windowState(); // Zoom didn't change flags.
} else if(oldstate & Qt::WindowMaximized && !(oldstate & Qt::WindowFullScreen)) {