output-management: fix output destroy handling

Currently we update output-management clients based on changes in the
wlr_output_layout struct. However, this is obviously wrong on closer
inspection due to the fact that not all outputs are tracked by the
wlr_output_layout at all times. I think this aproach was originally
cargo-culted from some other output-management implementation and it
needs to go.

Luckily, the solution is quite simple since the only way to configure
outputs using river is through the wlr-output-management protocol. This
means we need to send a new configuration to the output-management
client in 3 cases:

1. An output is created
2. An output is destroyed
3. A wlr-output-management config from a client is applied
This commit is contained in:
Isaac Freund
2024-02-25 13:42:58 +01:00
parent f2b6893b00
commit 60b06a6741
2 changed files with 8 additions and 15 deletions

View File

@ -409,6 +409,8 @@ fn handleDestroy(listener: *wl.Listener(*wlr.Output), _: *wlr.Output) void {
util.gpa.destroy(output);
server.root.sendOutputManagerConfig();
server.root.applyPending();
}