The wlr-output-management protocol requires that either all of the changes from an apply request be applied successfully, in which case a "succeeded" event is sent, or all of the changes are reverted and a "failed" event is sent. As written, this could partially commit changes, then fail.
Test the changes first (even for an "apply" event), then commit or rollback as appropriate.
ZSSVUMLBSC7P4VMBM5GPNOBJGCUGYQGSU5SXIIZWX54Y674EZWDAC if (test) {ok &= wlr_output_test(wlr_output);wlr_output_rollback(wlr_output);} elseok &= wlr_output_commit(wlr_output);
if (!(ok = wlr_output_test(wlr_output)))break;}wl_list_for_each(config_head, &config->heads, link) {if (ok && !test)wlr_output_commit(config_head->state.output);elsewlr_output_rollback(config_head->state.output);