Draft: backend/{wayland,x11}: disable outputs when user closes windows

Closed novenary requested to merge 9ary/wlroots:nested-backend-close-handling into master

This implements @emersion's suggestion in #3589.

Known problems:

  • when re-enabling the output in the wayland backend, the title is unset, I'm not sure if other state needs to be restored
  • when closing windows, swaymsg -t get_outputs shows the output as powered off, but not as disabled like swaymsg output * disable does
    • as I've found out, DPMS on/off also toggles the outputs in the same way, so that makes sense
  • this is going to break compositors like cage which exit when all outputs are gone (the goal of this MR is specifically to give cage more control, but this might still be a concern for other compositors)

I think disabling outputs without destroying them might be nice to have, but maybe this isn't the way to go for what we're trying to do? Pointers welcome.

Edited by novenary

Merge request reports