From 0a68122e52d8a406de878285e4def2174c5c821e Mon Sep 17 00:00:00 2001 From: hujianwei Date: Thu, 3 Nov 2022 04:06:28 +0000 Subject: [PATCH] Fix damage unioning upon ViewMove * subcompositor.c (ViewMove): Union previous damage at right place. --- subcompositor.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/subcompositor.c b/subcompositor.c index f393a47..3cd4ec6 100644 --- a/subcompositor.c +++ b/subcompositor.c @@ -1647,6 +1647,13 @@ ViewMove (View *view, int x, int y) view->x = x; view->y = y; + /* If the subcompositor is not garbaged, then damage the union + of the previous view bounds and the current view bounds. + This part calculates the previous view bounds. */ + + if (view->subcompositor && !IsGarbaged (view->subcompositor)) + ViewUnionInferiorBounds (view, &damage); + if (view->parent) { view->abs_x = view->parent->abs_x + x; @@ -1720,13 +1727,8 @@ ViewMove (View *view, int x, int y) } } - /* If the subcompositor is not garbaged, then damage the union - of the previous view bounds and the current view bounds. */ if (view->subcompositor) { - if (!IsGarbaged (view->subcompositor)) - ViewUnionInferiorBounds (view, &damage); - /* Update the subcompositor bounds. */ SubcompositorUpdateBounds (view->subcompositor, doflags);