From 76225943555cf3540d137875c09e4e8db8fd33fb Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 28 Feb 2012 10:22:27 +0200 Subject: 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 --- src/gui/kernel/qwidget_win.cpp | 4 ++-- 1 file 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); } } -- cgit v0.12