diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..fafc79d --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,5 @@ +# Bolt's Journal ⚡ + +## 2024-05-23 - [Blocking XSync in Drawing Loop] +**Learning:** `XSync` forces a round-trip to the X server, blocking the client until the server processes the request. In a drawing loop like `drw_map`, this adds significant latency (up to network RTT) per frame/update. +**Action:** Use `XCopyArea` without explicit `XSync` for drawing operations. `XNextEvent` (or explicit `XFlush`) will handle buffer flushing asynchronously. diff --git a/drw.c b/drw.c index 7e99a38..9959672 100644 --- a/drw.c +++ b/drw.c @@ -494,7 +494,6 @@ 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); } unsigned int drw_fontset_getwidth(Drw *drw, const char *text) {