diff options
author | emersion <contact@emersion.fr> | 2018-04-06 15:59:50 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-04-06 15:59:50 -0400 |
commit | 0c627918bb1d4c056744157b8c37fb1f62c5ca8e (patch) | |
tree | 44d90991356a0ee0a42ab0a5aabfeb963b8e0823 | |
parent | Don't damage the whole output (diff) | |
download | sway-0c627918bb1d4c056744157b8c37fb1f62c5ca8e.tar.gz sway-0c627918bb1d4c056744157b8c37fb1f62c5ca8e.tar.zst sway-0c627918bb1d4c056744157b8c37fb1f62c5ca8e.zip |
Damage all surfaces when damaging whole container
-rw-r--r-- | sway/desktop/output.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 0f25cff1..db2928fd 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -401,6 +401,17 @@ void output_damage_view(struct sway_output *output, struct sway_view *view, | |||
401 | damage_surface_iterator, &data); | 401 | damage_surface_iterator, &data); |
402 | } | 402 | } |
403 | 403 | ||
404 | static void output_damage_whole_container_iterator(struct sway_container *con, | ||
405 | void *data) { | ||
406 | struct sway_output *output = data; | ||
407 | |||
408 | if (!sway_assert(con->type != C_VIEW, "expected a view")) { | ||
409 | return; | ||
410 | } | ||
411 | |||
412 | output_damage_view(output, con->sway_view, true); | ||
413 | } | ||
414 | |||
404 | void output_damage_whole_container(struct sway_output *output, | 415 | void output_damage_whole_container(struct sway_output *output, |
405 | struct sway_container *con) { | 416 | struct sway_container *con) { |
406 | float scale = output->wlr_output->scale; | 417 | float scale = output->wlr_output->scale; |
@@ -411,6 +422,9 @@ void output_damage_whole_container(struct sway_output *output, | |||
411 | .height = con->height * scale, | 422 | .height = con->height * scale, |
412 | }; | 423 | }; |
413 | wlr_output_damage_add_box(output->damage, &box); | 424 | wlr_output_damage_add_box(output->damage, &box); |
425 | |||
426 | container_descendants(con, C_VIEW, output_damage_whole_container_iterator, | ||
427 | output); | ||
414 | } | 428 | } |
415 | 429 | ||
416 | static void damage_handle_destroy(struct wl_listener *listener, void *data) { | 430 | static void damage_handle_destroy(struct wl_listener *listener, void *data) { |