1From bb9093eb419f98bbb8ba2171643a1b27469e782f Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 16 Jul 2020 17:18:42 +0800
4Subject: [PATCH 11/17] qwaylandshmbackingstore: Ignore resizing with no screen
5
6Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
7---
8 src/client/qwaylandshmbackingstore.cpp | 3 +++
9 1 file changed, 3 insertions(+)
10
11diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
12index dc7ff67..515ec19 100644
13--- a/src/client/qwaylandshmbackingstore.cpp
14+++ b/src/client/qwaylandshmbackingstore.cpp
15@@ -274,6 +274,9 @@ void QWaylandShmBackingStore::resize(const QSize &size)
16     int scale = waylandWindow()->scale();
17     QSize sizeWithMargins = (size + QSize(margins.left()+margins.right(),margins.top()+margins.bottom())) * scale;
18
19+    if (!QPlatformScreen::platformScreenForWindow(window()))
20+        return;
21+
22     // We look for a free buffer to draw into. If the buffer is not the last buffer we used,
23     // that is mBackBuffer, and the size is the same we memcpy the old content into the new
24     // buffer so that QPainter is happy to find the stuff it had drawn before. If the new
25--
262.20.1
27
28