Windows: Respect geometry set before native window creation

Task-number: QTBUG-31071
Change-Id: Idab21c5996d1dc31b0a6fab4960c3c48a50d4966
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-05-27 13:41:15 +02:00 committed by The Qt Project
parent cf366e8b86
commit 60768a0af9

View File

@ -503,10 +503,14 @@ QWindowsWindow::WindowData
const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle));
QWindowsContext::instance()->setWindowCreationContext(context);
if (context->frameX < 0)
context->frameX = 0;
if (context->frameY < 0)
context->frameY = 0;
QRect screenGeometry;
if (QScreen *screen = w->screen())
screenGeometry = screen->availableVirtualGeometry();
if (context->frameX < screenGeometry.left())
context->frameX = screenGeometry.left();
if (context->frameY < screenGeometry.top())
context->frameY = screenGeometry.top();
if (QWindowsContext::verboseWindows)
qDebug().nospace()