From c074e87f8d6053a473e774167ea9054950214c55 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:45:34 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Optimize=20drw=5Fmap=20by?= =?UTF-8?q?=20replacing=20XSync=20with=20XFlush?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaced XSync with XFlush in drw_map to reduce blocking round-trips to the X server. This significantly improves performance during frequent redraws (e.g., status bar updates) by making the drawing non-blocking. XSync waits for the X server to process the request, which is unnecessary for simple drawing operations where order is guaranteed by the protocol. Added inline comment explaining the optimization. --- drw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drw.c b/drw.c index 7e99a386..3f22213b 100644 --- a/drw.c +++ b/drw.c @@ -494,7 +494,8 @@ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, } XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); + /* XSync forces a round-trip to the X server. XFlush is sufficient and non-blocking. */ + XFlush(drw->dpy); } unsigned int drw_fontset_getwidth(Drw *drw, const char *text) {