From 6e5e651f905de13c6780a555ad9794e9894ffa7b Mon Sep 17 00:00:00 2001 From: Charlotte Meyer Date: Sun, 15 Aug 2021 17:00:06 +0000 Subject: [PATCH] Damage output when layer-shell surface updates --- kiwmi/desktop/layer_shell.c | 5 ++++- kiwmi/desktop/output.c | 1 + kiwmi/desktop/xdg_shell.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kiwmi/desktop/layer_shell.c b/kiwmi/desktop/layer_shell.c index a3bd08a..b00bced 100644 --- a/kiwmi/desktop/layer_shell.c +++ b/kiwmi/desktop/layer_shell.c @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -46,6 +47,8 @@ kiwmi_layer_commit_notify(struct wl_listener *listener, void *UNUSED(data)) bool layer_changed = layer->layer != layer->layer_surface->current.layer; bool geom_changed = memcmp(&old_geom, &layer->geom, sizeof(old_geom)) != 0; + bool buffer_changed = pixman_region32_not_empty( + &layer->layer_surface->surface->buffer_damage); if (layer_changed) { wl_list_remove(&layer->link); @@ -53,7 +56,7 @@ kiwmi_layer_commit_notify(struct wl_listener *listener, void *UNUSED(data)) wl_list_insert(&output->layers[layer->layer], &layer->link); } - if (layer_changed || geom_changed) { + if (buffer_changed || layer_changed || geom_changed) { output->damaged = 2; } } diff --git a/kiwmi/desktop/output.c b/kiwmi/desktop/output.c index ea697af..bb64f72 100644 --- a/kiwmi/desktop/output.c +++ b/kiwmi/desktop/output.c @@ -9,6 +9,7 @@ #include +#include #include #include #include diff --git a/kiwmi/desktop/xdg_shell.c b/kiwmi/desktop/xdg_shell.c index b731d5c..a90b563 100644 --- a/kiwmi/desktop/xdg_shell.c +++ b/kiwmi/desktop/xdg_shell.c @@ -9,6 +9,7 @@ #include +#include #include #include #include