output: ensure we don't run into an assert() on VT switch

Also reduce log spam from failed output commits that
can happen for various reasons outside of our control.

Fixes: #1667
This commit is contained in:
Consolatis 2024-04-08 16:29:20 +02:00 committed by Johan Malm
parent 2c2341530b
commit c9de358075
2 changed files with 12 additions and 1 deletions

View file

@ -55,7 +55,7 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output)
return false; return false;
} }
if (!wlr_output_commit(wlr_output)) { if (!wlr_output_commit(wlr_output)) {
wlr_log(WLR_ERROR, "Failed to commit output %s", wlr_log(WLR_INFO, "Failed to commit output %s",
wlr_output->name); wlr_output->name);
return false; return false;
} }

View file

@ -60,6 +60,17 @@ output_frame_notify(struct wl_listener *listener, void *data)
return; return;
} }
if (!output->scene_output) {
/*
* TODO: This is a short term fix for issue #1667,
* a proper fix would require restructuring
* the life cycle of scene outputs, e.g.
* creating them on new_output_notify() only.
*/
wlr_log(WLR_INFO, "Failed to render new frame: no scene-output");
return;
}
struct wlr_output *wlr_output = output->wlr_output; struct wlr_output *wlr_output = output->wlr_output;
struct server *server = output->server; struct server *server = output->server;