core: track if root is damaged

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-04-13 12:39:47 +01:00
parent dad2bf53f8
commit 10400d7e62
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
3 changed files with 4 additions and 0 deletions

View File

@ -106,6 +106,7 @@ bool paint_all_new(session_t *ps, struct managed_win *const t) {
// part of the image we want to reuse
region_t reg_damage;
reg_damage = get_damage(ps, ps->o.monitor_repaint || !ps->o.use_damage);
ps->root_damaged = false;
if (!pixman_region32_not_empty(&reg_damage)) {
pixman_region32_fini(&reg_damage);

View File

@ -264,6 +264,8 @@ typedef struct session {
bool render_queued;
/// For tracking damage regions
struct damage_ring damage_ring;
/// Whether the root image has been changed since last render
bool root_damaged;
/// Whether all windows are currently redirected.
bool redirected;
/// Pre-generated alpha pictures.

View File

@ -1205,6 +1205,7 @@ void root_damaged(session_t *ps) {
log_error("Failed to bind root back pixmap");
}
}
ps->root_damaged = true;
}
// Mark screen damaged