desktop: subsurface destruction artifacts
When a sub-surface is destroyed the old geometry is not damaged. This results in artificats where parts of the gone sub-subsurface are still visible on-screen.
This should now be finally fixable using https://smithay.github.io/smithay/smithay/wayland/compositor/fn.add_destruction_hook.html. When creating a Window/LayerSurface/Popup it's subsurfaces (and new ones appearing later) should receive a destruction hook, that for example sends their last geometry over a channel on drop. On accumulated_damage the toplevel-structure could drain the other end of that channel and add it to the damage.
I guess we would need to drain to an intermediate vec to support multiple outputs/renderer keeping the last n external damage.
yeah true. but the basic idea should work for the most part, I hope. Because the destruction_callback is not giving us much more options than using something like a channel.
Not sure if this works for all subsurfaces. There could be a sub-subsurface where the parent subsurface gets unmapped. This should also use the geometry of the sub-subsurface as damage. So we should also damage on unmap and use the complete (previous?) surface tree geometry for the damage.
Not sure if this works for all subsurfaces. There could be a sub-subsurface where the parent subsurface gets unmapped. This should also use the geometry of the sub-subsurface as damage. So we should also damage on unmap and use the complete (previous?) surface tree geometry for the damage.
Well in that case we probably need a dirty_flag for the Window (maybe an AtomicBool) and diff the surface_tree on the next accumulated_damage call, if that is true, or something like that.