aboutsummaryrefslogtreecommitdiff
path: root/examples/multi-pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/multi-pointer.c')
-rw-r--r--examples/multi-pointer.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/examples/multi-pointer.c b/examples/multi-pointer.c
index 6b67e8eb..83ee253d 100644
--- a/examples/multi-pointer.c
+++ b/examples/multi-pointer.c
@@ -166,8 +166,8 @@ void new_output_notify(struct wl_listener *listener, void *data) {
struct wlr_output *output = data;
struct sample_state *sample = wl_container_of(listener, sample, new_output);
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
- if (wl_list_length(&output->modes) > 0) {
- struct wlr_output_mode *mode = wl_container_of((&output->modes)->prev, mode, link);
+ if (!wl_list_empty(&output->modes)) {
+ struct wlr_output_mode *mode = wl_container_of(output->modes.prev, mode, link);
wlr_output_set_mode(output, mode);
}
sample_output->output = output;
@@ -301,14 +301,6 @@ int main(int argc, char *argv[]) {
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);
-
struct wlr_xcursor_theme *theme = wlr_xcursor_theme_load("default", 16);
if (!theme) {
wlr_log(L_ERROR, "Failed to load cursor theme");