From 04fd058e0f65504b53c7800e6dc2927511114c18 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 27 Oct 2018 12:33:48 +0530 Subject: [PATCH] Wayland: Improve FPS for rendering with vsync Now a new frame event is requested after every render. This means that effective FPS should be close to the refresh rate of the output source. --- kitty/child-monitor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index a633bc479..eedade786 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -623,7 +623,7 @@ render_os_window(OSWindow *os_window, double now, unsigned int active_window_id, os_window->last_active_tab = os_window->active_tab; os_window->last_num_tabs = os_window->num_tabs; os_window->last_active_window_id = active_window_id; os_window->focused_at_last_render = os_window->is_focused; os_window->is_damaged = false; - if (global_state.is_wayland) os_window->wayland_render_state = RENDER_FRAME_NOT_REQUESTED; + if (global_state.is_wayland) wayland_request_frame_render(os_window); #undef WD #undef TD } @@ -640,9 +640,7 @@ render(double now) { OSWindow *w = global_state.os_windows + i; if (!w->num_tabs || !should_os_window_be_rendered(w)) continue; if (global_state.is_wayland && w->wayland_render_state != RENDER_FRAME_READY && OPT(sync_to_monitor)) { - if (w->wayland_render_state == RENDER_FRAME_NOT_REQUESTED) { - wayland_request_frame_render(w); - } + if (w->wayland_render_state == RENDER_FRAME_NOT_REQUESTED) wayland_request_frame_render(w); return; } bool needs_render = w->is_damaged;