Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2026-01-23 - XSync vs XFlush in drw_map
**Learning:** In X11 window managers, using XSync in frequent drawing paths (like drw_map) causes blocking round-trips to the X server, significantly degrading performance.
**Action:** Use XFlush for drawing operations where synchronous confirmation is not required.
4 changes: 3 additions & 1 deletion drw.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ 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 is used here instead of XSync to avoid blocking round-trips
* during frequent drawing operations. */
XFlush(drw->dpy);
}

unsigned int drw_fontset_getwidth(Drw *drw, const char *text) {
Expand Down