summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreenwindow.cpp')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenwindow.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
index 53880c877e..a46258a401 100644
--- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp
@@ -47,18 +47,18 @@
QT_BEGIN_NAMESPACE
-QOffscreenWindow::QOffscreenWindow(QWindow *window)
+QOffscreenWindow::QOffscreenWindow(QWindow *window, bool frameMarginsEnabled)
: QPlatformWindow(window)
, m_positionIncludesFrame(false)
, m_visible(false)
, m_pendingGeometryChangeOnShow(true)
+ , m_frameMarginsRequested(frameMarginsEnabled)
{
- if (window->windowState() == Qt::WindowNoState)
- setGeometry(window->geometry());
- else
+ if (window->windowState() == Qt::WindowNoState) {
+ setGeometry(windowGeometry());
+ } else {
setWindowState(window->windowStates());
-
- QWindowSystemInterface::flushWindowSystemEvents();
+ }
static WId counter = 0;
m_winId = ++counter;
@@ -80,7 +80,7 @@ void QOffscreenWindow::setGeometry(const QRect &rect)
m_positionIncludesFrame = qt_window_private(window())->positionPolicy == QWindowPrivate::WindowFrameInclusive;
- setFrameMarginsEnabled(true);
+ setFrameMarginsEnabled(m_frameMarginsRequested);
setGeometryImpl(rect);
m_normalGeometry = geometry();
@@ -168,7 +168,7 @@ void QOffscreenWindow::setFrameMarginsEnabled(bool enabled)
void QOffscreenWindow::setWindowState(Qt::WindowStates state)
{
- setFrameMarginsEnabled(!(state & Qt::WindowFullScreen));
+ setFrameMarginsEnabled(m_frameMarginsRequested && !(state & Qt::WindowFullScreen));
m_positionIncludesFrame = false;
if (state & Qt::WindowMinimized)