summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
index 892168a1dc..81f262f9ed 100644
--- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
@@ -157,10 +157,13 @@ QMargins QOffscreenWindow::frameMargins() const
void QOffscreenWindow::setFrameMarginsEnabled(bool enabled)
{
- if (enabled && !(window()->flags() & Qt::FramelessWindowHint))
+ if (enabled
+ && !(window()->flags() & Qt::FramelessWindowHint)
+ && (parent() == nullptr)) {
m_margins = QMargins(2, 2, 2, 2);
- else
+ } else {
m_margins = QMargins(0, 0, 0, 0);
+ }
}
void QOffscreenWindow::setWindowState(Qt::WindowState state)