diff options
-rw-r--r-- | backend/noop/output.c | 4 | ||||
-rw-r--r-- | include/backend/noop.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/backend/noop/output.c b/backend/noop/output.c index a2595eff..14ba5ed0 100644 --- a/backend/noop/output.c +++ b/backend/noop/output.c @@ -61,8 +61,8 @@ struct wlr_output *wlr_noop_add_output(struct wlr_backend *wlr_backend) { strncpy(wlr_output->make, "noop", sizeof(wlr_output->make)); strncpy(wlr_output->model, "noop", sizeof(wlr_output->model)); - snprintf(wlr_output->name, sizeof(wlr_output->name), "NOOP-%d", - wl_list_length(&backend->outputs) + 1); + snprintf(wlr_output->name, sizeof(wlr_output->name), "NOOP-%ld", + ++backend->last_output_num); wl_list_insert(&backend->outputs, &output->link); diff --git a/include/backend/noop.h b/include/backend/noop.h index 4198baad..e301eb07 100644 --- a/include/backend/noop.h +++ b/include/backend/noop.h @@ -8,6 +8,7 @@ struct wlr_noop_backend { struct wlr_backend backend; struct wl_display *display; struct wl_list outputs; + size_t last_output_num; bool started; }; |