aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-08 12:44:42 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-03-11 10:56:20 -0400
commite7788c22eed7d307a8d123792bec21d8a948cfd6 (patch)
tree38efb0569d04b6a0cf5458f6025f94b27a745da5 /sway/desktop/output.c
parentfix "directive argument is null" errors (diff)
downloadsway-e7788c22eed7d307a8d123792bec21d8a948cfd6.tar.gz
sway-e7788c22eed7d307a8d123792bec21d8a948cfd6.tar.zst
sway-e7788c22eed7d307a8d123792bec21d8a948cfd6.zip
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.
Diffstat (limited to 'sway/desktop/output.c')
-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 d7d3fc07..54b9f294 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) {
473 wlr_output_damage_add_box(output->damage, &box); 473 wlr_output_damage_add_box(output->damage, &box);
474} 474}
475 475
476static void damage_child_views_iterator(struct sway_container *con,
477 void *data) {
478 if (!con->view || !view_is_visible(con->view)) {
479 return;
480 }
481 struct sway_output *output = data;
482 bool whole = true;
483 output_view_for_each_surface(output, con->view, damage_surface_iterator,
484 &whole);
485}
486
476void output_damage_whole_container(struct sway_output *output, 487void output_damage_whole_container(struct sway_output *output,
477 struct sway_container *con) { 488 struct sway_container *con) {
478 // Pad the box by 1px, because the width is a double and might be a fraction 489 // 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,
484 }; 495 };
485 scale_box(&box, output->wlr_output->scale); 496 scale_box(&box, output->wlr_output->scale);
486 wlr_output_damage_add_box(output->damage, &box); 497 wlr_output_damage_add_box(output->damage, &box);
498 // Damage subsurfaces as well, which may extend outside the box
499 if (con->view) {
500 damage_child_views_iterator(con, output);
501 } else {
502 container_for_each_child(con, damage_child_views_iterator, output);
503 }
487} 504}
488 505
489static void damage_handle_destroy(struct wl_listener *listener, void *data) { 506static void damage_handle_destroy(struct wl_listener *listener, void *data) {