path: root/src
diff options
authorTor Arne Vestbø <>2019-07-31 14:10:56 +0200
committerTor Arne Vestbø <>2019-08-24 02:21:59 +0200
commit29b1ac069721e3ebfd883685c9dce0524125ec39 (patch)
tree1cf95f94a122a9ca074a1d5639f243b368d408ce /src
parente1b0dfc1d406e132fd42ecebcc7bd260e9ef8f9b (diff)
Don't defer platform backingstore creation if we already have a platform window
The creation was made lazy in 18f415e46d592f, for those platforms (macOS) that need a platform window to successfully create a platform backingstore. But we don't need to delay creation if we actually have a platform window at the time of constructing the QBackingStore. Change-Id: I6367736ddca82900dec2751a85a8bc35cc742bb5 Reviewed-by: Volker Hilsheimer <> Reviewed-by: Lars Knoll <> Reviewed-by: Timur Pocheptsov <>
Diffstat (limited to 'src')
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp
index b9ed3d4995..f86dfbfba1 100644
--- a/src/gui/painting/qbackingstore.cpp
+++ b/src/gui/painting/qbackingstore.cpp
@@ -95,6 +95,11 @@ public:
QBackingStore::QBackingStore(QWindow *window)
: d_ptr(new QBackingStorePrivate(window))
+ if (window->handle()) {
+ // Create platform backingstore up front if we have a platform window,
+ // otherwise delay the creation until absolutely necessary.
+ handle();
+ }