summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-05-03 13:50:46 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-05-04 07:30:59 (GMT)
commit97e423b50d316c3a9e2083c3a9d80bf16554faa9 (patch)
tree619700b27cedb4eb4a362ba9fa1a4ccce224b82c
parent95de3f34d9dba4cd95f1f3d32b35c4a4d97e70d9 (diff)
downloadQt-97e423b50d316c3a9e2083c3a9d80bf16554faa9.zip
Qt-97e423b50d316c3a9e2083c3a9d80bf16554faa9.tar.gz
Qt-97e423b50d316c3a9e2083c3a9d80bf16554faa9.tar.bz2
Do not allow fullscreen/maximized windows to expand beyond client rect
Automatic layouting of widgets still managed to layout maximized and fullscreen windows larger than client rect in Symbian in some cases. Fixed by limiting window dimensions to client area boundaries in setGeometry_sys if the window is maximized or fullscreen. Task-number: QTBUG-5697 Reviewed-by: Sami Merila
-rw-r--r--src/gui/kernel/qwidget_s60.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 12bcc4b..5e9584b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -235,19 +235,21 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
QSize oldSize(q->size());
QRect oldGeom(data.crect);
- // Lose maximized status if deliberate resize
- if (w != oldSize.width() || h != oldSize.height())
- data.window_state &= ~Qt::WindowMaximized;
-
bool checkExtra = true;
- if (q->isWindow() && (data.window_state & Qt::WindowFullScreen)) {
- // Do not modity window size for fullscreen windows, if requested
- // size is already equal to clientRect.
+ if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
+ // Do not allow fullscreen/maximized windows to expand beyond client rect
TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ w = qMin(w, r.Width());
+ h = qMin(h, r.Height());
+
if (w == r.Width() && h == r.Height())
checkExtra = false;
}
+ // Lose maximized status if deliberate resize
+ if (w != oldSize.width() || h != oldSize.height())
+ data.window_state &= ~Qt::WindowMaximized;
+
if (checkExtra && extra) { // any size restrictions?
w = qMin(w,extra->maxw);
h = qMin(h,extra->maxh);