summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2012-02-01 17:09:44 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-07 00:20:15 (GMT)
commit77a60ad53788aee253ba667cec2928510843c3e6 (patch)
tree5fdc46a7b52c05dae200516771c9fa688bcce6e8 /src/gui
parentb4efb21eb01fdede5ff8d609f0e4d8cee4d8eea7 (diff)
downloadQt-77a60ad53788aee253ba667cec2928510843c3e6.zip
Qt-77a60ad53788aee253ba667cec2928510843c3e6.tar.gz
Qt-77a60ad53788aee253ba667cec2928510843c3e6.tar.bz2
Use available geometry when maximized.
Use the available geometry as a maximized window would fit on the desktop in the available area (some space is used up by task bar, system menu, etc.) as opposed to the fullscreen geometry which would be the entire screen. cherry-picked from qt5/qtbase: c051d3350e4f227f71921e7db7e52d02525cc8fc Change-Id: Id20fdf68bcbd2eb1fc7db5cf1658bbefbe5737a4 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_qpa.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp
index 996f0af..7de9e50 100644
--- a/src/gui/kernel/qwidget_qpa.cpp
+++ b/src/gui/kernel/qwidget_qpa.cpp
@@ -441,7 +441,15 @@ void QWidgetPrivate::hide_sys()
void QWidgetPrivate::setMaxWindowState_helper()
{
- setFullScreenSize_helper(); //### decoration size
+ Q_Q(QWidget);
+
+ const uint old_state = data.in_set_window_state;
+ data.in_set_window_state = 1;
+
+ const QRect desktop = qApp->desktop()->availableGeometry(qApp->desktop()->screenNumber(q));
+ q->setGeometry(desktop);
+
+ data.in_set_window_state = old_state;
}
void QWidgetPrivate::setFullScreenSize_helper()