diff options
author | Simon Ser <contact@emersion.fr> | 2022-03-19 13:58:16 +0100 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-05-10 16:37:21 +0000 |
commit | 7b7562eb658f180ddb8c712803d8c646613a86c3 (patch) | |
tree | 34079eeca7d3363409151ae30f37c5ecd29fd3e7 /backend | |
parent | 8b0d4947cc77907f010a69bb9cd212a456cfdf08 (diff) |
backend/headless: allow variable refresh rate
Instead of waking up each 16ms to emit a frame event, arm the timer
when the output is committed. This allows the headless backend to
idle when nothing changes on screen, and behaves similarly to the
other backends.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/headless/output.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/headless/output.c b/backend/headless/output.c index f03d6ee0..10de845f 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -70,6 +70,8 @@ static bool output_commit(struct wlr_output *wlr_output) { wlr_output_send_present(wlr_output, &present_event); } + wl_event_source_timer_update(output->frame_timer, output->frame_delay); + return true; } @@ -93,7 +95,6 @@ bool wlr_output_is_headless(struct wlr_output *wlr_output) { static int signal_frame(void *data) { struct wlr_headless_output *output = data; wlr_output_send_frame(&output->wlr_output); - wl_event_source_timer_update(output->frame_timer, output->frame_delay); return 0; } |