From 91331b0bafc4c658434209d274ca864bf548cba9 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 2 May 2017 12:19:28 -0400 Subject: [PATCH] added a flush to initial draw to eliminate a lag at startup --- lib/win.c | 3 ++- lib/x11.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/win.c b/lib/win.c index 6ee9edc..52715a3 100644 --- a/lib/win.c +++ b/lib/win.c @@ -83,8 +83,9 @@ void win_loop(void) { x11_events_take(); if (x11_running()) x11_flip(); + } else { + x11_flush(); } - x11_flush(); } x11_finish(); } diff --git a/lib/x11.c b/lib/x11.c index 532ddac..69c720a 100644 --- a/lib/x11.c +++ b/lib/x11.c @@ -177,6 +177,7 @@ bool x11_running(void) { void x11_flip(void) { Config->redraw(X.width, X.height); XCopyArea(X.display, X.pixmap, X.window, X.gc, 0, 0, X.width, X.height, 0, 0); + x11_flush(); } void x11_flush(void) { -- 2.54.0