summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-03-30 11:58:37 +0300
committerPaul Olav Tvete <paul.tvete@qt.io>2017-04-06 13:29:01 +0000
commit0624085b73ff4d6537e3dd406f6b3701806626d0 (patch)
tree766746751ce7a86624a22b6f8a71e7cca753dbca /src
parentc50f6a832916c573a631b1b060e764705fe50434 (diff)
Don't set margin on offscreen window if it has a parent
Offscreen platform had window frame margins set to 2 by default unless Qt::FramelessWindowHint had been set. Margins must not be set to 2 if the window has a parent. This change fixes two tests in tst_QWindowContainer for offscreen platform. Change-Id: Ib1577c301ea3a3b240bfa7c46ff12510dd2bcef0 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-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)