output: Set output mode during main commit

Removes duplication across all the backends to finally apply the mode
to the output.
This commit is contained in:
Alexander Orzechowski 2023-06-26 18:02:02 -04:00
parent 530e58b96e
commit 8243399385
5 changed files with 14 additions and 21 deletions

View file

@ -814,6 +814,20 @@ bool wlr_output_commit_state(struct wlr_output *output,
wlr_swapchain_set_buffer_submitted(output->swapchain, pending.buffer);
}
if (pending.committed & WLR_OUTPUT_STATE_MODE) {
switch (pending.mode_type) {
case WLR_OUTPUT_STATE_MODE_FIXED:
wlr_output_update_mode(output, pending.mode);
break;
case WLR_OUTPUT_STATE_MODE_CUSTOM:
wlr_output_update_custom_mode(output,
pending.custom_mode.width,
pending.custom_mode.height,
pending.custom_mode.refresh);
break;
}
}
struct wlr_output_event_commit event = {
.output = output,
.committed = pending.committed,