From 69e92de0104d6c5cb4d905b670bdd2b64b968c4c Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Thu, 28 May 2026 19:04:41 +0900 Subject: [PATCH] wait for compositor --- wayland.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wayland.c b/wayland.c index dbd2dee..38942bc 100644 --- a/wayland.c +++ b/wayland.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -321,11 +322,8 @@ waylandthread(void *_) (void)_; threadsetname("wayland"); - dpy = wl_display_connect(nil); - if(dpy == nil){ - fprint(2, "strans: wayland: cannot connect to display\n"); - return; - } + while((dpy = wl_display_connect(nil)) == nil) + poll(nil, 0, 1000); xkb = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if(xkb == nil){ wl_display_disconnect(dpy);