Init eventloop directly after wl_connect
this makes sure the eventloop is initialized before any event dispatching. fixes occasional segfaults I observed on resume.
This commit is contained in:
parent
b63aaffcd1
commit
376cc5fcd4
2
main.c
2
main.c
@ -1205,6 +1205,7 @@ int main(int argc, char **argv) {
|
|||||||
"WAYLAND_DISPLAY environment variable.");
|
"WAYLAND_DISPLAY environment variable.");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
state.eventloop = loop_create();
|
||||||
|
|
||||||
struct wl_registry *registry = wl_display_get_registry(state.display);
|
struct wl_registry *registry = wl_display_get_registry(state.display);
|
||||||
wl_registry_add_listener(registry, ®istry_listener, &state);
|
wl_registry_add_listener(registry, ®istry_listener, &state);
|
||||||
@ -1269,7 +1270,6 @@ int main(int argc, char **argv) {
|
|||||||
daemonize();
|
daemonize();
|
||||||
}
|
}
|
||||||
|
|
||||||
state.eventloop = loop_create();
|
|
||||||
loop_add_fd(state.eventloop, wl_display_get_fd(state.display), POLLIN,
|
loop_add_fd(state.eventloop, wl_display_get_fd(state.display), POLLIN,
|
||||||
display_in, NULL);
|
display_in, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user