summaryrefslogtreecommitdiffstats
path: root/sway/desktop
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-05-05 19:43:12 +0100
committerLibravatar emersion <contact@emersion.fr>2018-05-10 23:03:50 +0100
commitbec80f15519f686c64485685289155568c9bfa9e (patch)
treece19c596754ac2413bddea4a6cd395882682567f /sway/desktop
parentRender borders with damage (diff)
downloadsway-bec80f15519f686c64485685289155568c9bfa9e.tar.gz
sway-bec80f15519f686c64485685289155568c9bfa9e.tar.zst
sway-bec80f15519f686c64485685289155568c9bfa9e.zip
Damage borders when damaging view
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c17
-rw-r--r--sway/desktop/wl_shell.c2
-rw-r--r--sway/desktop/xdg_shell_v6.c2
-rw-r--r--sway/desktop/xwayland.c2
4 files changed, 16 insertions, 7 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
787void output_damage_view(struct sway_output *output, struct sway_view *view, 787static 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
808void output_damage_from_view(struct sway_output *output,
809 struct sway_view *view) {
810 output_damage_view(output, view, false);
811}
812
808static void output_damage_whole_container_iterator(struct sway_container *con, 813static 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
834static void damage_handle_destroy(struct wl_listener *listener, void *data) { 843static void damage_handle_destroy(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c
index e97a898e..99e8947b 100644
--- a/sway/desktop/wl_shell.c
+++ b/sway/desktop/wl_shell.c
@@ -85,7 +85,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
85 // TODO: Let floating views do whatever 85 // TODO: Let floating views do whatever
86 view_update_size(view, wl_shell_view->pending_width, 86 view_update_size(view, wl_shell_view->pending_width,
87 wl_shell_view->pending_height); 87 wl_shell_view->pending_height);
88 view_damage(view, false); 88 view_damage_from(view);
89} 89}
90 90
91static void handle_destroy(struct wl_listener *listener, void *data) { 91static void handle_destroy(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index fcee8ce9..8ecb330d 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -177,7 +177,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
177 view_update_size(view, xdg_shell_v6_view->pending_width, 177 view_update_size(view, xdg_shell_v6_view->pending_width,
178 xdg_shell_v6_view->pending_height); 178 xdg_shell_v6_view->pending_height);
179 view_update_title(view, false); 179 view_update_title(view, false);
180 view_damage(view, false); 180 view_damage_from(view);
181} 181}
182 182
183static void handle_new_popup(struct wl_listener *listener, void *data) { 183static void handle_new_popup(struct wl_listener *listener, void *data) {
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index b4eda71f..8f935760 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -222,7 +222,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
222 // TODO: Let floating views do whatever 222 // TODO: Let floating views do whatever
223 view_update_size(view, xwayland_view->pending_width, 223 view_update_size(view, xwayland_view->pending_width,
224 xwayland_view->pending_height); 224 xwayland_view->pending_height);
225 view_damage(view, false); 225 view_damage_from(view);
226 view_update_title(view, false); 226 view_update_title(view, false);
227} 227}
228 228