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