https://github.com/baskerville/bspwm/commit/1560df35be303807052c235634eb8d59415c37ff

From 1560df35be303807052c235634eb8d59415c37ff Mon Sep 17 00:00:00 2001
From: David Hoppenbrouwers <david@salt-inc.org>
Date: Tue, 25 Jan 2022 00:09:42 +0100
Subject: [PATCH] Fix windows sometimes not appearing

Fixes #935.
---
 src/bspwm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bspwm.c b/src/bspwm.c
index 9c6be76c..8b9b5d14 100644
--- a/src/bspwm.c
+++ b/src/bspwm.c
@@ -36,6 +36,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <xcb/xinerama.h>
+#include <xcb/xcb_aux.h>
 #include "types.h"
 #include "desktop.h"
 #include "monitor.h"
@@ -248,6 +249,7 @@ int main(int argc, char *argv[])
 			}
 
 			if (FD_ISSET(dpy_fd, &descriptors)) {
+				xcb_aux_sync(dpy);
 				while ((event = xcb_poll_for_event(dpy)) != NULL) {
 					handle_event(event);
 					free(event);
