inclement / vivarium

A dynamic tiling Wayland compositor using wlroots
GNU General Public License v3.0
372 stars 13 forks source link

Surfaces are sometimes messed up when resuming from suspend #30

Closed inclement closed 3 years ago

inclement commented 3 years ago

When I suspend (e.g. systemctl suspend) then start up again, Vivarium usually works fine.

Sometimes it doesn't work fine, it draws one of the currently-open views filling the screen but not the actual workspace that should be shown on the current output. Clicking and typing seem to act on the windows that should be there, suggesting Vivarium is truly running correctly except for what is drawn where.

Changing virtual desktop (and maybe creating windows) may change what surface is displayed, but in an inconsistent way without clear rules and it's never the correct desktop contents.

This never seems to happen when suspending/resuming over a short period, but reliably happens if it's been a few hours. I'm not certain if this is confirmation bias, I don't see why the timing should matter much.

I've no idea what's up here - rendering is sort of working, but how is the output getting totally the wrong things drawn to it? Maybe outputs are getting added/removed or something and we're missing that.

inclement commented 3 years ago

This is probably a result of not properly handling output events, I think if during suspend/resume the output is initially inactive (e.g. monitor sleeping) Vivarium's internal state gets messed up.

The solution should be to properly handle output destroy and create, including making sure no drawing is associated with the dead output.