From cf5bbf36cda2ae81367dfccca61db36e289c6c12 Mon Sep 17 00:00:00 2001 From: fakechen Date: Thu, 28 Apr 2022 18:58:12 -0700 Subject: [PATCH] output.c: fix turn off the external screen error First turn off the external screen and then turn it on, the program crashes. Signed-off-by: fakechen Signed-off-by: sunzhigang --- src/output.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/output.c b/src/output.c index d4863a9f..4d26453b 100644 --- a/src/output.c +++ b/src/output.c @@ -28,15 +28,18 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { struct output *output = wl_container_of(listener, output, frame); + struct wlr_scene *scene = output->server->scene; + struct wlr_scene_output *scene_output = wlr_scene_get_scene_output( + scene, output->wlr_output); if (!output->wlr_output->enabled) { return; } - wlr_scene_output_commit(output->scene_output); + wlr_scene_output_commit(scene_output); struct timespec now = { 0 }; clock_gettime(CLOCK_MONOTONIC, &now); - wlr_scene_output_send_frame_done(output->scene_output, &now); + wlr_scene_output_send_frame_done(scene_output, &now); } static void