aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-03-08 12:44:42 -0500
committeremersion <contact@emersion.fr>2019-03-10 01:20:36 +0100
commit7580718d12ed752ed5565e28ce3d46c3a589ffe3 (patch)
tree580a2d72afadba2463d7771e130ae6569b85ded5
parenta73e8f1328a247766f4ff78fdc73b38488dec385 (diff)
downloadsway-7580718d12ed752ed5565e28ce3d46c3a589ffe3.zip
sway-7580718d12ed752ed5565e28ce3d46c3a589ffe3.tar.gz
sway-7580718d12ed752ed5565e28ce3d46c3a589ffe3.tar.bz2
output_damage_whole_container: damage subsurfaces
This adds an iterative call in `output_damage_whole_container` to damage the subsurfaces for all visible views that are inside of the container. This is needed to damage subsurfaces that extend outside the box of the container. Without this, those subsurfaces will create artifacts when moving or resizing.
-rw-r--r--sway/desktop/output.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index d7d3fc0..54b9f29 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -473,6 +473,17 @@ void output_damage_box(struct sway_output *output, struct wlr_box *_box) {
wlr_output_damage_add_box(output->damage, &box);
}
+static void damage_child_views_iterator(struct sway_container *con,
+ void *data) {
+ if (!con->view || !view_is_visible(con->view)) {
+ return;
+ }
+ struct sway_output *output = data;
+ bool whole = true;
+ output_view_for_each_surface(output, con->view, damage_surface_iterator,
+ &whole);
+}
+
void output_damage_whole_container(struct sway_output *output,
struct sway_container *con) {
// Pad the box by 1px, because the width is a double and might be a fraction
@@ -484,6 +495,12 @@ void output_damage_whole_container(struct sway_output *output,
};
scale_box(&box, output->wlr_output->scale);
wlr_output_damage_add_box(output->damage, &box);
+ // Damage subsurfaces as well, which may extend outside the box
+ if (con->view) {
+ damage_child_views_iterator(con, output);
+ } else {
+ container_for_each_child(con, damage_child_views_iterator, output);
+ }
}
static void damage_handle_destroy(struct wl_listener *listener, void *data) {