aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-26 23:13:09 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-27 18:50:32 -0400
commit776b81d499ae4430c0ebe5421b119c6b3355a1ce (patch)
tree4baf0e29c987f337f3548ef28e582469b9ed9001 /rootston
parente841e5602b9fb7447564f75fc9d1e835a215e51a (diff)
Fix surface layer damage tracking
Diffstat (limited to 'rootston')
-rw-r--r--rootston/layer_shell.c16
-rw-r--r--rootston/output.c8
2 files changed, 18 insertions, 6 deletions
diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c
index 35896228..5efdf3c9 100644
--- a/rootston/layer_shell.c
+++ b/rootston/layer_shell.c
@@ -149,8 +149,6 @@ static void arrange_layer(struct wlr_output *output, struct wl_list *list,
apply_exclusive(usable_area, state->anchor, state->exclusive_zone,
state->margin.top, state->margin.right,
state->margin.bottom, state->margin.left);
- wlr_log(L_DEBUG, "arranged layer at %dx%d@%d,%d",
- box.width, box.height, box.x, box.y);
wlr_layer_surface_configure(layer, box.width, box.height);
}
}
@@ -221,11 +219,17 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
struct wlr_output *wlr_output = layer_surface->output;
if (wlr_output != NULL) {
struct roots_output *output = wlr_output->data;
- output_damage_from_local_surface(output, layer_surface->surface,
- layer->geo.x, layer->geo.y, 0);
+ struct wlr_box old_geo = layer->geo;
arrange_layers(wlr_output);
- output_damage_from_local_surface(output, layer_surface->surface,
- layer->geo.x, layer->geo.y, 0);
+ if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) {
+ output_damage_whole_local_surface(output, layer_surface->surface,
+ old_geo.x, old_geo.y, 0);
+ output_damage_whole_local_surface(output, layer_surface->surface,
+ layer->geo.x, layer->geo.y, 0);
+ } else {
+ output_damage_from_local_surface(output, layer_surface->surface,
+ layer->geo.x, layer->geo.y, 0);
+ }
}
}
diff --git a/rootston/output.c b/rootston/output.c
index 7c2c6d44..aa74c8d7 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -664,6 +664,14 @@ static void damage_whole_surface(struct wlr_surface *surface,
wlr_output_damage_add_box(output->damage, &box);
}
+void output_damage_whole_local_surface(struct roots_output *output,
+ struct wlr_surface *surface, double ox, double oy, float rotation) {
+ struct wlr_output_layout_output *layout = wlr_output_layout_get(
+ output->desktop->layout, output->wlr_output);
+ damage_whole_surface(surface, ox + layout->x, oy + layout->y,
+ rotation, output);
+}
+
static void damage_whole_decoration(struct roots_view *view,
struct roots_output *output) {
if (!view->decorated || view->wlr_surface == NULL) {