summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_migration.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/exa/exa_migration.c b/exa/exa_migration.c
index 59db25b72..9d0eda0de 100644
--- a/exa/exa_migration.c
+++ b/exa/exa_migration.c
@@ -257,6 +257,13 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
pExaPixmap->offscreen = save_offscreen;
pPixmap->devKind = save_pitch;
+ /* Try to prevent source valid region from growing too many rects by
+ * removing parts of it which are also in the destination valid region.
+ * Removing anything beyond that would lead to data loss.
+ */
+ if (REGION_NUM_RECTS(pValidSrc) > 20)
+ REGION_SUBTRACT(pScreen, pValidSrc, pValidSrc, pValidDst);
+
/* The copied bits are now valid in destination */
REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);