From 8d12ed1439d5400a39cacbccdd292b91548c92ca Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 4 Jan 2026 18:35:39 +0000 Subject: [PATCH] Replace blocking XSync with XFlush in rendering and resizing paths Replaces `XSync` with `XFlush` in `drw_map` (rendering) and `resizeclient` (resizing) to eliminate blocking round-trips to the X server. This change significantly improves performance by: - Reducing latency in bar drawing updates (frequently called). - Smoother window animations by avoiding frame-blocking waits in the animation loop. - Removing unnecessary synchronization overhead where immediate error handling is not required. Verified that compilation succeeds and logic remains sound for asynchronous X11 operations. --- client.c | 2 +- drw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index 13f1e27f..c03e6b4b 100644 --- a/client.c +++ b/client.c @@ -279,7 +279,7 @@ void resizeclient(Client *c, int x, int y, int w, int h) { XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); configure(c); - XSync(dpy, False); + XFlush(dpy); } void updatetitle(Client *c) { diff --git a/drw.c b/drw.c index 7e99a386..e3f9501b 100644 --- a/drw.c +++ b/drw.c @@ -494,7 +494,7 @@ 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); + XFlush(drw->dpy); } unsigned int drw_fontset_getwidth(Drw *drw, const char *text) {