From 376cc5fcd486a3065b4c04ee4a1573606fb09038 Mon Sep 17 00:00:00 2001 From: Christian Meissl Date: Fri, 16 Feb 2024 21:26:35 +0100 Subject: [PATCH] Init eventloop directly after wl_connect this makes sure the eventloop is initialized before any event dispatching. fixes occasional segfaults I observed on resume. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 5057da0..549d6f6 100644 --- a/main.c +++ b/main.c @@ -1205,6 +1205,7 @@ int main(int argc, char **argv) { "WAYLAND_DISPLAY environment variable."); return EXIT_FAILURE; } + state.eventloop = loop_create(); struct wl_registry *registry = wl_display_get_registry(state.display); wl_registry_add_listener(registry, ®istry_listener, &state); @@ -1269,7 +1270,6 @@ int main(int argc, char **argv) { daemonize(); } - state.eventloop = loop_create(); loop_add_fd(state.eventloop, wl_display_get_fd(state.display), POLLIN, display_in, NULL);