diff options
-rw-r--r-- | examples/pointer.c | 8 | ||||
-rw-r--r-- | examples/rotation.c | 7 | ||||
-rw-r--r-- | examples/simple.c | 8 | ||||
-rw-r--r-- | examples/touch.c | 8 |
4 files changed, 2 insertions, 29 deletions
diff --git a/examples/pointer.c b/examples/pointer.c index 34f6c896..00002921 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -395,13 +395,7 @@ int main(int argc, char *argv[]) { image->width, image->height, image->hotspot_x, image->hotspot_y, 0); clock_gettime(CLOCK_MONOTONIC, &state.last_frame); - const char *socket = wl_display_add_socket_auto(display); - if (!socket) { - wlr_log_errno(L_ERROR, "Unable to open wayland socket"); - wlr_backend_destroy(wlr); - exit(1); - } - setenv("_WAYLAND_DISPLAY", socket, true); + if (!wlr_backend_start(wlr)) { wlr_log(L_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); diff --git a/examples/rotation.c b/examples/rotation.c index a7bbbf32..618e91af 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -248,13 +248,6 @@ int main(int argc, char *argv[]) { wl_signal_add(&wlr->events.new_input, &state.new_input); state.new_input.notify = new_input_notify; clock_gettime(CLOCK_MONOTONIC, &state.last_frame); - const char *socket = wl_display_add_socket_auto(display); - if (!socket) { - wlr_log_errno(L_ERROR, "Unable to open wayland socket"); - wlr_backend_destroy(wlr); - exit(1); - } - setenv("_WAYLAND_DISPLAY", socket, true); state.renderer = wlr_backend_get_renderer(wlr); if (!state.renderer) { diff --git a/examples/simple.c b/examples/simple.c index 7bf95601..0c58f933 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -165,13 +165,7 @@ int main() { wl_signal_add(&wlr->events.new_input, &state.new_input); state.new_input.notify = new_input_notify; clock_gettime(CLOCK_MONOTONIC, &state.last_frame); - const char *socket = wl_display_add_socket_auto(display); - if (!socket) { - wlr_log_errno(L_ERROR, "Unable to open wayland socket"); - wlr_backend_destroy(wlr); - exit(1); - } - setenv("_WAYLAND_DISPLAY", socket, true); + if (!wlr_backend_start(wlr)) { wlr_log(L_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); diff --git a/examples/touch.c b/examples/touch.c index 93905ffd..1d56a9ff 100644 --- a/examples/touch.c +++ b/examples/touch.c @@ -273,14 +273,6 @@ int main(int argc, char *argv[]) { exit(EXIT_FAILURE); } - const char *socket = wl_display_add_socket_auto(display); - if (!socket) { - wlr_log_errno(L_ERROR, "Unable to open wayland socket"); - wlr_backend_destroy(wlr); - exit(1); - } - setenv("_WAYLAND_DISPLAY", socket, true); - if (!wlr_backend_start(wlr)) { wlr_log(L_ERROR, "Failed to start backend"); wlr_backend_destroy(wlr); |