From f12006e64405de72ac09f364ef25ee9701c9b755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 6 Oct 2016 17:49:52 +0200 Subject: [PATCH] Don't resize windows that aren't attached to a platform window QWindows that aren't created, and therefore don't have a platform window attached, should not be treated as "normal" windows. The expectation, in our code, is that these windows won't get their geometry updated by the platform plugin, and that the geometry is only changed by the owner. In QQuickWidget's case this was causing the scene to be rendered incorrectly. Task-number: QTBUG-50973 Change-Id: Iea62dfb7fa90cbe450a662c5792c7c4f49c991fd Reviewed-by: Laszlo Agocs --- src/gui/kernel/qplatformscreen.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp index 8e9767d69e..3ec7a4cf3f 100644 --- a/src/gui/kernel/qplatformscreen.cpp +++ b/src/gui/kernel/qplatformscreen.cpp @@ -335,6 +335,10 @@ void QPlatformScreen::resizeMaximizedWindows() for (int i = 0; i < windows.size(); ++i) { QWindow *w = windows.at(i); + // Skip non-platform windows, e.g., offscreen windows. + if (!w->handle()) + continue; + if (platformScreenForWindow(w) != this) continue;