path: root/src/gui/kernel
diff options
authorLaszlo Agocs <>2018-03-13 10:17:10 +0100
committerLaszlo Agocs <>2018-03-13 12:49:54 +0000
commita060ee2802c72d8ce22f42635d1740bf2f84bed7 (patch)
tree804e7b01b30137940bdefb0894597856abfdde03 /src/gui/kernel
parentaaace8fbdb0d4d4db703abe3a67f4c9f67df1f5b (diff)
QWindowWindow: Avoid resize events from the ctor
When calling showFullScreen(), the setwindowStates call in the QWindowsWindow constructor led to generating a resize event. This is pretty bad for example when QOpenGLWindow is involved since the QWindow's platformWindow member is not even set yet (handle() == nullptr) so everything related to OpenGL contexts starts failing (as there is no underlying platform window yet as far as the QWindow is concerned). In short, generating geometry changes from the platformwindow ctor is a bad idea. Use initialize() instead for that. Task-number: QTBUG-67027 Change-Id: I35d11949213eb21f81b2ff2d4f2282cb36510210 Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'src/gui/kernel')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qopenglwindow.cpp b/src/gui/kernel/qopenglwindow.cpp
index cf3d712421..c3a264f1e8 100644
--- a/src/gui/kernel/qopenglwindow.cpp
+++ b/src/gui/kernel/qopenglwindow.cpp
@@ -222,6 +222,9 @@ void QOpenGLWindowPrivate::initialize()
if (context)
+ if (!q->handle())
+ qWarning("Attempted to initialize QOpenGLWindow without a platform window");
context.reset(new QOpenGLContext);