After e.g. wlopm --off, some external outputs will appear to labwc to
disconnect and reconnect. (I have one HDMI monitor which does this
repeatedly every 10 seconds as it cycles through inputs.) Currently,
these outputs are immediately reconfigured and enabled when they
reconnect, after which point they remain on all night.
For a screensaver/powersave mode that actually works, we need to prevent
this. This change adds logic to not auto-configure new outputs once all
existing outputs are turned off.
Downsides as currently implemented are:
- once reconnected, outputs are logically "disabled", not just "off",
and wlopm --on cannot re-enable them (wlr-randr or kanshi works).
- this doesn't prevent external clients like kanshi from re-enabling
outputs immediately when they reconnect, so it's necessary to stop
kanshi during powersave and restart it afterward.
In spite of the downsides, I've been running with these changes for a
couple weeks with good results.