mirror of
https://github.com/labwc/labwc.git
synced 2026-04-10 08:21:07 -04:00
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 <chenzigui@kylinos.cn> Signed-off-by: sunzhigang <sunzhigang@kylinos.cn>
This commit is contained in:
parent
60966f5fde
commit
cf5bbf36cd
1 changed files with 5 additions and 2 deletions
|
|
@ -28,15 +28,18 @@ static void
|
||||||
output_frame_notify(struct wl_listener *listener, void *data)
|
output_frame_notify(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct output *output = wl_container_of(listener, output, frame);
|
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) {
|
if (!output->wlr_output->enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wlr_scene_output_commit(output->scene_output);
|
wlr_scene_output_commit(scene_output);
|
||||||
|
|
||||||
struct timespec now = { 0 };
|
struct timespec now = { 0 };
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
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
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue