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-24 - Blocking XSync in Layouts
**Learning:** `instantwm` (and other X11 WMs) can suffer from significant latency during layout operations (like tag switching or resizing multiple windows) if `XSync` is used in the `resizeclient` hot path. `XSync` forces a round-trip to the X server for *every* window resized, which scales linearly with the number of windows (O(N)).
**Action:** Replace `XSync` with `XFlush` in `resizeclient` (and similar hot paths like `drw_map` if safe). `XFlush` pushes the requests to the server without waiting for a reply, which is sufficient for simple geometry updates where the client doesn't need immediate feedback. This eliminates N round-trips, making layout changes effectively instantaneous from the client's perspective.
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);
/* Optimization: Use XFlush instead of XSync to avoid blocking round-trip to X server */
XFlush(dpy);
}

void updatetitle(Client *c) {
Expand Down