From c9de3580752ef3322ee3ce4cf13c10f151509407 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:29:20 +0200 Subject: [PATCH] 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 --- src/common/scene-helpers.c | 2 +- src/output.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/scene-helpers.c b/src/common/scene-helpers.c index b8a7ac47..6c7ed9ea 100644 --- a/src/common/scene-helpers.c +++ b/src/common/scene-helpers.c @@ -55,7 +55,7 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output) return false; } 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); return false; } diff --git a/src/output.c b/src/output.c index e81abaee..67d8de77 100644 --- a/src/output.c +++ b/src/output.c @@ -60,6 +60,17 @@ output_frame_notify(struct wl_listener *listener, void *data) 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 server *server = output->server;