perf: reduce event loop timeout to 4ms, remove polling schedule_frame

The 16ms dispatch timeout added up to 16ms of input latency.
4ms reduces this to ~4ms maximum.

Removing unconditional wlr_output_schedule_frame from the main loop
stops flooding the swapchain. The output frame callback in
handle_output_frame drives rendering at vsync naturally.
This commit is contained in:
lkn 2026-06-24 19:15:31 +02:00
parent 70659969d6
commit c37fd28572
1 changed files with 1 additions and 5 deletions

View File

@ -1141,11 +1141,7 @@ wl_event_loop_run(void)
wl_display_flush_clients(wl_state.display);
extern void W_WLClientDispatchPending(void);
W_WLClientDispatchPending();
wl_event_loop_dispatch(loop, 16);
/* Schedule frame AFTER dispatch so the frame event on the next
* iteration renders content from commits processed above. */
if (wl_state.output)
wlr_output_schedule_frame(wl_state.output);
wl_event_loop_dispatch(loop, 4);
/* Check inotify for defaults database changes */
#ifdef HAVE_INOTIFY