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-09 - X11 Synchronization Bottlenecks
**Learning:** `XSync` forces a round-trip to the X server, blocking the client until the server responds. In `drw_map` (used for bar drawing) and `resizeclient` (used for window resizing), this adds significant latency.
**Action:** Replace `XSync` with `XFlush` in rendering and non-dependent configuration paths. `XFlush` sends the request buffer without waiting, which is sufficient for operations like drawing or configuring windows where the client doesn't immediately read back the result.
3 changes: 2 additions & 1 deletion client.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ 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);
/* Use XFlush to avoid blocking round-trip latency */
XFlush(dpy);
}

void updatetitle(Client *c) {
Expand Down
4 changes: 2 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

# Xinerama, comment if you don't want it
XINERAMALIBS = -lXinerama
XINERAMAFLAGS = -DXINERAMA
#XINERAMALIBS = -lXinerama
#XINERAMAFLAGS = -DXINERAMA

# freetype
FREETYPELIBS = -lfontconfig -lXft
Expand Down
3 changes: 2 additions & 1 deletion drw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/* Use XFlush to avoid blocking round-trip latency */
XFlush(drw->dpy);
}

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