aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-03-30 13:18:50 -0400
committerLibravatar emersion <contact@emersion.fr>2018-03-30 17:16:35 -0400
commita776ecbb860608e0f75430a53ea75a6ed19ac746 (patch)
treef664978ac74c3fc13993ed709cc1015c025d3344 /sway/tree/view.c
parentMerge pull request #1667 from emersion/wlroots-xwayland-map (diff)
downloadsway-a776ecbb860608e0f75430a53ea75a6ed19ac746.tar.gz
sway-a776ecbb860608e0f75430a53ea75a6ed19ac746.tar.zst
sway-a776ecbb860608e0f75430a53ea75a6ed19ac746.zip
Add lite damage tracking
This skips the renderer if nothing has changed, and renders everything otherwise.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 480ff693..b7d1a41b 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -1,9 +1,10 @@
1#include <wayland-server.h> 1#include <wayland-server.h>
2#include <wlr/types/wlr_output_layout.h> 2#include <wlr/types/wlr_output_layout.h>
3#include "log.h"
4#include "sway/output.h"
3#include "sway/tree/container.h" 5#include "sway/tree/container.h"
4#include "sway/tree/layout.h" 6#include "sway/tree/layout.h"
5#include "sway/tree/view.h" 7#include "sway/tree/view.h"
6#include "log.h"
7 8
8const char *view_get_title(struct sway_view *view) { 9const char *view_get_title(struct sway_view *view) {
9 if (view->iface.get_prop) { 10 if (view->iface.get_prop) {
@@ -105,3 +106,18 @@ struct sway_container *container_view_destroy(struct sway_container *view) {
105 arrange_windows(parent, -1, -1); 106 arrange_windows(parent, -1, -1);
106 return parent; 107 return parent;
107} 108}
109
110void view_damage_whole(struct sway_view *view) {
111 struct sway_container *cont = NULL;
112 for (int i = 0; i < root_container.children->length; ++i) {
113 cont = root_container.children->items[i];
114 if (cont->type == C_OUTPUT) {
115 output_damage_whole_view(cont->sway_output, view);
116 }
117 }
118}
119
120void view_damage_from(struct sway_view *view) {
121 // TODO
122 view_damage_whole(view);
123}