mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-22 07:02:28 +00:00
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.
This commit is contained in:
parent
8b0d4947cc
commit
7b7562eb65
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user