aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
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/tree/view.c
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/tree/view.c')
-rw-r--r--sway/tree/view.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index fe944466..afd7eade 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -199,11 +199,11 @@ void view_close(struct sway_view *view) {
199 } 199 }
200} 200}
201 201
202void view_damage(struct sway_view *view, bool whole) { 202void view_damage_from(struct sway_view *view) {
203 for (int i = 0; i < root_container.children->length; ++i) { 203 for (int i = 0; i < root_container.children->length; ++i) {
204 struct sway_container *cont = root_container.children->items[i]; 204 struct sway_container *cont = root_container.children->items[i];
205 if (cont->type == C_OUTPUT) { 205 if (cont->type == C_OUTPUT) {
206 output_damage_view(cont->sway_output, view, whole); 206 output_damage_from_view(cont->sway_output, view);
207 } 207 }
208 } 208 }
209} 209}
@@ -333,7 +333,7 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
333 arrange_children_of(cont->parent); 333 arrange_children_of(cont->parent);
334 input_manager_set_focus(input_manager, cont); 334 input_manager_set_focus(input_manager, cont);
335 335
336 view_damage(view, true); 336 container_damage_whole(cont);
337 view_handle_container_reparent(&view->container_reparent, NULL); 337 view_handle_container_reparent(&view->container_reparent, NULL);
338 338
339 view_execute_criteria(view); 339 view_execute_criteria(view);
@@ -351,7 +351,7 @@ void view_unmap(struct sway_view *view) {
351 ws->sway_workspace->fullscreen = NULL; 351 ws->sway_workspace->fullscreen = NULL;
352 } 352 }
353 353
354 view_damage(view, true); 354 container_damage_whole(view->swayc);
355 355
356 wl_list_remove(&view->surface_new_subsurface.link); 356 wl_list_remove(&view->surface_new_subsurface.link);
357 wl_list_remove(&view->container_reparent.link); 357 wl_list_remove(&view->container_reparent.link);
@@ -380,10 +380,10 @@ void view_update_position(struct sway_view *view, double ox, double oy) {
380 380
381 // TODO: Only allow this if the view is floating (this function will only be 381 // TODO: Only allow this if the view is floating (this function will only be
382 // called in response to wayland clients wanting to reposition themselves). 382 // called in response to wayland clients wanting to reposition themselves).
383 view_damage(view, true); 383 container_damage_whole(view->swayc);
384 view->swayc->x = ox; 384 view->swayc->x = ox;
385 view->swayc->y = oy; 385 view->swayc->y = oy;
386 view_damage(view, true); 386 container_damage_whole(view->swayc);
387} 387}
388 388
389void view_update_size(struct sway_view *view, int width, int height) { 389void view_update_size(struct sway_view *view, int width, int height) {
@@ -391,11 +391,11 @@ void view_update_size(struct sway_view *view, int width, int height) {
391 return; 391 return;
392 } 392 }
393 393
394 view_damage(view, true); 394 container_damage_whole(view->swayc);
395 // Should we update the swayc width/height here too? 395 // Should we update the swayc width/height here too?
396 view->width = width; 396 view->width = width;
397 view->height = height; 397 view->height = height;
398 view_damage(view, true); 398 container_damage_whole(view->swayc);
399} 399}
400 400
401 401
@@ -414,7 +414,7 @@ static void view_child_handle_surface_commit(struct wl_listener *listener,
414 struct sway_view_child *child = 414 struct sway_view_child *child =
415 wl_container_of(listener, child, surface_commit); 415 wl_container_of(listener, child, surface_commit);
416 // TODO: only accumulate damage from the child 416 // TODO: only accumulate damage from the child
417 view_damage(child->view, false); 417 view_damage_from(child->view);
418} 418}
419 419
420static void view_child_handle_surface_new_subsurface( 420static void view_child_handle_surface_new_subsurface(
@@ -476,12 +476,16 @@ void view_child_init(struct sway_view_child *child,
476 view_init_subsurfaces(child->view, surface); 476 view_init_subsurfaces(child->view, surface);
477 477
478 // TODO: only damage the whole child 478 // TODO: only damage the whole child
479 view_damage(child->view, true); 479 if (child->view->swayc) {
480 container_damage_whole(child->view->swayc);
481 }
480} 482}
481 483
482void view_child_destroy(struct sway_view_child *child) { 484void view_child_destroy(struct sway_view_child *child) {
483 // TODO: only damage the whole child 485 // TODO: only damage the whole child
484 view_damage(child->view, true); 486 if (child->view->swayc) {
487 container_damage_whole(child->view->swayc);
488 }
485 489
486 wl_list_remove(&child->surface_commit.link); 490 wl_list_remove(&child->surface_commit.link);
487 wl_list_remove(&child->surface_destroy.link); 491 wl_list_remove(&child->surface_destroy.link);