aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-04-07 11:53:10 -0400
committerGitHub <noreply@github.com>2018-04-07 11:53:10 -0400
commitc47b4d4edb7714612ec7236fafda5ca54cb92ce4 (patch)
tree9a7f991e9c3da20351b58c53e0b6dbe376f12dca /sway/tree
parentf5a9bd5cb75b37376b98eadbff2facb7e0021d57 (diff)
parent0c627918bb1d4c056744157b8c37fb1f62c5ca8e (diff)
downloadsway-c47b4d4edb7714612ec7236fafda5ca54cb92ce4.tar.xz
Merge pull request #1756 from emersion/output-damage
Fine-grained damage tracking
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/view.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 9855c5e1..99b44720 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -79,20 +79,15 @@ void view_close(struct sway_view *view) {
}
}
-void view_damage_whole(struct sway_view *view) {
+void view_damage(struct sway_view *view, bool whole) {
for (int i = 0; i < root_container.children->length; ++i) {
struct sway_container *cont = root_container.children->items[i];
if (cont->type == C_OUTPUT) {
- output_damage_whole_view(cont->sway_output, view);
+ output_damage_view(cont->sway_output, view, whole);
}
}
}
-void view_damage_from(struct sway_view *view) {
- // TODO
- view_damage_whole(view);
-}
-
static void view_get_layout_box(struct sway_view *view, struct wlr_box *box) {
struct sway_container *output = container_parent(view->swayc, C_OUTPUT);
@@ -191,7 +186,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
arrange_windows(cont->parent, -1, -1);
input_manager_set_focus(input_manager, cont);
- view_damage_whole(view);
+ view_damage(view, true);
view_handle_container_reparent(&view->container_reparent, NULL);
}
@@ -202,7 +197,7 @@ void view_unmap(struct sway_view *view) {
wl_signal_emit(&view->events.unmap, view);
- view_damage_whole(view);
+ view_damage(view, true);
wl_list_remove(&view->surface_new_subsurface.link);
wl_list_remove(&view->container_reparent.link);
@@ -220,10 +215,10 @@ void view_update_position(struct sway_view *view, double ox, double oy) {
return;
}
- view_damage_whole(view);
+ view_damage(view, true);
view->swayc->x = ox;
view->swayc->y = oy;
- view_damage_whole(view);
+ view_damage(view, true);
}
void view_update_size(struct sway_view *view, int width, int height) {
@@ -231,10 +226,10 @@ void view_update_size(struct sway_view *view, int width, int height) {
return;
}
- view_damage_whole(view);
+ view_damage(view, true);
view->width = width;
view->height = height;
- view_damage_whole(view);
+ view_damage(view, true);
}
@@ -253,7 +248,7 @@ static void view_child_handle_surface_commit(struct wl_listener *listener,
struct sway_view_child *child =
wl_container_of(listener, child, surface_commit);
// TODO: only accumulate damage from the child
- view_damage_from(child->view);
+ view_damage(child->view, false);
}
static void view_child_handle_surface_new_subsurface(
@@ -315,12 +310,12 @@ void view_child_init(struct sway_view_child *child,
view_init_subsurfaces(child->view, surface);
// TODO: only damage the whole child
- view_damage_whole(child->view);
+ view_damage(child->view, true);
}
void view_child_destroy(struct sway_view_child *child) {
// TODO: only damage the whole child
- view_damage_whole(child->view);
+ view_damage(child->view, true);
wl_list_remove(&child->surface_commit.link);
wl_list_remove(&child->surface_destroy.link);