Blame SOURCES/qtwayland-do-not-redraw-decorations-everytime.patch

8d8a62
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
8d8a62
index 3fe2ce80..6d660e64 100644
8d8a62
--- a/src/client/qwaylandshmbackingstore.cpp
8d8a62
+++ b/src/client/qwaylandshmbackingstore.cpp
8d8a62
@@ -289,11 +289,13 @@ void QWaylandShmBackingStore::resize(const QSize &size)
8d8a62
         buffer = getBuffer(sizeWithMargins);
8d8a62
     }
8d8a62
 
8d8a62
-    qsizetype oldSize = mBackBuffer ? mBackBuffer->image()->sizeInBytes() : 0;
8d8a62
+    qsizetype oldSizeInBytes = mBackBuffer ? mBackBuffer->image()->sizeInBytes() : 0;
8d8a62
+    qsizetype newSizeInBytes = buffer->image()->sizeInBytes();
8d8a62
+
8d8a62
     // mBackBuffer may have been deleted here but if so it means its size was different so we wouldn't copy it anyway
8d8a62
-    if (mBackBuffer != buffer && oldSize == buffer->image()->sizeInBytes()) {
8d8a62
-        memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), buffer->image()->sizeInBytes());
8d8a62
-    }
8d8a62
+   if (mBackBuffer != buffer && oldSizeInBytes == newSizeInBytes)
8d8a62
+        memcpy(buffer->image()->bits(), mBackBuffer->image()->constBits(), newSizeInBytes);
8d8a62
+
8d8a62
     mBackBuffer = buffer;
8d8a62
     // ensure the new buffer is at the beginning of the list so next time getBuffer() will pick
8d8a62
     // it if possible
8d8a62
@@ -302,8 +304,9 @@ void QWaylandShmBackingStore::resize(const QSize &size)
8d8a62
         mBuffers.prepend(buffer);
8d8a62
     }
8d8a62
 
8d8a62
-    if (windowDecoration() && window()->isVisible())
8d8a62
+    if (windowDecoration() && window()->isVisible() && oldSizeInBytes != newSizeInBytes) {
8d8a62
         windowDecoration()->update();
8d8a62
+    }
8d8a62
 }
8d8a62
 
8d8a62
 QImage *QWaylandShmBackingStore::entireSurface() const