summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-09 17:45:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-10 19:16:57 +0000
commit861593368e72714b1272e74a34cd02316b6a4061 (patch)
tree09d7feb41c8d7cca64e18830c6eb7dad08835c76
parented0188ec58c5572ce6fdad0cc431c2689872a299 (diff)
Set Qt::SubWindow on windows embedded by QWidget::createWindowContainer
The embedded window is parented into the containing QWindowContainer widget, which may either have a window handle itself, or is a child of a widget that has one (typically the top level). By setting Qt::SubWindow we inform clients about the embedded window's place in the world, allowing e.g. QPlatformIntegration::defaultWindowState to choose the correct state (Qt::WindowNoState) for the window instead of making it Qt::WindowMaximized on iOS. Change-Id: Icf834192d99fee455aaba3c57bee1a4f1fde5025 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 296621a52f220dfd5456f6fb936f513a7b85b1af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index b4d889fdfa..5484544444 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -234,6 +234,8 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
d->fakeParent.setObjectName(windowName + QLatin1String("ContainerFakeParent"));
d->window->setParent(&d->fakeParent);
+ d->window->setFlag(Qt::SubWindow);
+
setAcceptDrops(true);
connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow*)), this, SLOT(focusWindowChanged(QWindow*)));