diff options
Diffstat (limited to 'src/plugins/platforms')
-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() |