Subsurface: add commit listener on create if mapped

Subsurfaces may already be mapped when create is called, in which case
we must add the commit listener.
This commit is contained in:
Isaac Freund 2021-12-22 05:30:20 +00:00
parent 334ede00e1
commit 90aee02b70
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -74,6 +74,8 @@ pub fn create(wlr_subsurface: *wlr.Subsurface, parent: Parent) void {
wlr_subsurface.events.unmap.add(&subsurface.unmap);
wlr_subsurface.surface.events.new_subsurface.add(&subsurface.new_subsurface);
if (wlr_subsurface.mapped) wlr_subsurface.surface.events.commit.add(&subsurface.commit);
Subsurface.handleExisting(wlr_subsurface.surface, parent);
}