diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-05-27 13:41:15 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-27 15:46:48 +0200 |
commit | 60768a0af9f8773a46990e40051ac692521af055 (patch) | |
tree | 69bdfc9986b8133f17f158181c1b1e4953824532 /src/plugins/platforms/windows | |
parent | cf366e8b862a616efd7c3d4683d59971f795d476 (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 73c78f0090..8ce6dcc9e7 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -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() |