summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-02-28 08:22:27 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-28 10:00:56 (GMT)
commit76225943555cf3540d137875c09e4e8db8fd33fb (patch)
treea172f9fd84cbfacb7864a5c95f87841a1ddbbfc4 /src/gui
parent24398afa413d38c4fc38d09d1a218cf514ed3987 (diff)
downloadQt-76225943555cf3540d137875c09e4e8db8fd33fb.zip
Qt-76225943555cf3540d137875c09e4e8db8fd33fb.tar.gz
Qt-76225943555cf3540d137875c09e4e8db8fd33fb.tar.bz2
Fix window positioning regression.
The fix to bug QTBUG-10589 has affected the style flags of windows, which indirectly changed how their initial position is determined. Fixed initial position for windows with WS_POPUP style so that x and y cannot go negative, which makes QMainWindows with larger than screen initial dimensions to behave identically to Qt 4.7.4. Task-number: QTBUG-24071 Change-Id: Ie38cdd206df4be21cce823d7d94a4690a7cb01e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget_win.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 1881a4a..3fdc00c 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -427,8 +427,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
}
}
if (!wasMoved) {
- x = sw/2 - w/2;
- y = sh/2 - h/2;
+ x = qMax(sw/2 - w/2, 0);
+ y = qMax(sh/2 - h/2, 0);
}
}