From bd143f7df3be50b15b617275b0db2aac292b9a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 19 Jul 2020 22:10:52 +0200 Subject: [PATCH] Add fixme note to QWindowPrivate::setVisible about visibility during create Change-Id: I71cb5b560538887f85d92178ff17eaaecaf06904 Reviewed-by: Volker Hilsheimer --- src/gui/kernel/qwindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 1ba81387a9..3fed7c3776 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -354,8 +354,14 @@ void QWindowPrivate::setVisible(bool visible) return; // We only need to create the window if it's being shown - if (visible) + if (visible) { + // FIXME: At this point we've already updated the visible state of + // the QWindow, so if the platform layer reads the window state during + // creation, and reflects that in the native window, it will end up + // with a visible window. This may in turn result in resize or expose + // events from the platform before we have sent the show event below. q->create(); + } } if (visible) {