aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-06-12 20:18:43 -0400
committerSimon Ser <contact@emersion.fr>2023-06-13 09:19:51 +0000
commit73ca1ea48a208a1ef9b21ffe9f721a4289deb15c (patch)
tree83d93022db0ed7f37f7a029377ea488ee922afe6
parent495bcbeedde21eaa9d68ceef1fba5109d5d50dee (diff)
tinywl: Drop usage of wlr_output.pending
-rw-r--r--tinywl/tinywl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c
index 77502b3f..bfabac6e 100644
--- a/tinywl/tinywl.c
+++ b/tinywl/tinywl.c
@@ -602,13 +602,16 @@ static void server_new_output(struct wl_listener *listener, void *data) {
* refresh rate), and each monitor supports only a specific set of modes. We
* just pick the monitor's preferred mode, a more sophisticated compositor
* would let the user configure it. */
- if (!wl_list_empty(&wlr_output->modes)) {
- struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
- wlr_output_set_mode(wlr_output, mode);
- wlr_output_enable(wlr_output, true);
- if (!wlr_output_commit(wlr_output)) {
+ struct wlr_output_mode *mode = wlr_output_preferred_mode(wlr_output);
+ if (mode != NULL) {
+ struct wlr_output_state state = {0};
+ wlr_output_state_set_mode(&state, mode);
+ wlr_output_state_set_enabled(&state, true);
+ if (!wlr_output_commit_state(wlr_output, &state)) {
+ wlr_output_state_finish(&state);
return;
}
+ wlr_output_state_finish(&state);
}
/* Allocates and configures our state for this output */