diff options
author | emersion <contact@emersion.fr> | 2018-05-05 19:43:12 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-05-10 23:03:50 +0100 |
commit | bec80f15519f686c64485685289155568c9bfa9e (patch) | |
tree | ce19c596754ac2413bddea4a6cd395882682567f /sway/desktop/output.c | |
parent | Render borders with damage (diff) | |
download | sway-bec80f15519f686c64485685289155568c9bfa9e.tar.gz sway-bec80f15519f686c64485685289155568c9bfa9e.tar.zst sway-bec80f15519f686c64485685289155568c9bfa9e.zip |
Damage borders when damaging view
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 47461736..907ad6c9 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -784,8 +784,8 @@ void output_damage_surface(struct sway_output *output, double ox, double oy, | |||
784 | damage_surface_iterator, &data); | 784 | damage_surface_iterator, &data); |
785 | } | 785 | } |
786 | 786 | ||
787 | void output_damage_view(struct sway_output *output, struct sway_view *view, | 787 | static void output_damage_view(struct sway_output *output, |
788 | bool whole) { | 788 | struct sway_view *view, bool whole) { |
789 | if (!sway_assert(view->swayc != NULL, "expected a view in the tree")) { | 789 | if (!sway_assert(view->swayc != NULL, "expected a view in the tree")) { |
790 | return; | 790 | return; |
791 | } | 791 | } |
@@ -805,6 +805,11 @@ void output_damage_view(struct sway_output *output, struct sway_view *view, | |||
805 | damage_surface_iterator, &data); | 805 | damage_surface_iterator, &data); |
806 | } | 806 | } |
807 | 807 | ||
808 | void output_damage_from_view(struct sway_output *output, | ||
809 | struct sway_view *view) { | ||
810 | output_damage_view(output, view, false); | ||
811 | } | ||
812 | |||
808 | static void output_damage_whole_container_iterator(struct sway_container *con, | 813 | static void output_damage_whole_container_iterator(struct sway_container *con, |
809 | void *data) { | 814 | void *data) { |
810 | struct sway_output *output = data; | 815 | struct sway_output *output = data; |
@@ -827,8 +832,12 @@ void output_damage_whole_container(struct sway_output *output, | |||
827 | }; | 832 | }; |
828 | wlr_output_damage_add_box(output->damage, &box); | 833 | wlr_output_damage_add_box(output->damage, &box); |
829 | 834 | ||
830 | container_descendants(con, C_VIEW, output_damage_whole_container_iterator, | 835 | if (con->type == C_VIEW) { |
831 | output); | 836 | output_damage_whole_container_iterator(con, output); |
837 | } else { | ||
838 | container_descendants(con, C_VIEW, | ||
839 | output_damage_whole_container_iterator, output); | ||
840 | } | ||
832 | } | 841 | } |
833 | 842 | ||
834 | static void damage_handle_destroy(struct wl_listener *listener, void *data) { | 843 | static void damage_handle_destroy(struct wl_listener *listener, void *data) { |