]> git.neil.brown.name Git - edlib.git/commitdiff
display-x11: refresh the location of a pane before it was moved.
authorNeilBrown <neil@brown.name>
Tue, 10 Aug 2021 11:44:24 +0000 (21:44 +1000)
committerNeilBrown <neil@brown.name>
Wed, 11 Aug 2021 01:14:13 +0000 (11:14 +1000)
When a pane is moved we already refresh the place it goes to.
We need to also refresh the place it was moved from.

Signed-off-by: NeilBrown <neil@brown.name>
display-x11-xcb.c

index 29b33cebe559c3ef4311b21777fb555b21077ad9..c030eddf3c788995f4c1ad750873c64db5f45b35 100644 (file)
@@ -880,17 +880,21 @@ DEF_CMD(xcb_refresh_post)
                rel = pane_mapxy(ps->p, ci->home, 0, 0, False);
                if (rel.x != ps->x || rel.y != ps->y) {
                        /* Moved, so refresh all.
-                        * This rectangle might be too big if it is clipped
+                        * This rectangle might be too big if it is clipped,
+                        * but that doesn't really matter.
                         */
                        cairo_rectangle_int_t r = {
-                               .x = rel.x,
-                               .y = rel.y,
+                               .x = ps->x
+                               .y = ps->y,
                                .width = ps->w,
                                .height = ps->h,
                        };
                        cairo_region_union_rectangle(xd->need_update, &r);
                        ps->x = rel.x;
                        ps->y = rel.y;
+                       r.x = ps->x;
+                       r.y = ps->y;
+                       cairo_region_union_rectangle(xd->need_update, &r);
                } else if (ps->need_update) {
                        cairo_region_translate(ps->need_update, rel.x, rel.y);
                        cairo_region_union(xd->need_update, ps->need_update);