diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-05-03 13:50:46 (GMT) |
---|---|---|
committer | Timo Turunen <timo.p.turunen@nokia.com> | 2011-08-30 07:02:09 (GMT) |
commit | 35108903fa1c7b8d2d2afb86914de8ed5028c12d (patch) | |
tree | 671ad13a0a421bfaa2ebdb24a81d6176d8cb719a | |
parent | 9c76e0c868b189f811b6776d60a3836677a9ddea (diff) | |
download | Qt-35108903fa1c7b8d2d2afb86914de8ed5028c12d.zip Qt-35108903fa1c7b8d2d2afb86914de8ed5028c12d.tar.gz Qt-35108903fa1c7b8d2d2afb86914de8ed5028c12d.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
(cherry picked from commit e9040d183dce6188ae9d1493167cb7247a6d4a7b)
Reapplied after bad v4.7.4 merge
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index ada85ce..e437579 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); |