All outputs now have a unique integer ID, allocated from a bitfield pool in the
compositor.
Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
wl_list_init(&output->frame_callback_list);
+ output->id = ffs(~output->compositor->output_id_pool) - 1;
+ output->compositor->output_id_pool |= 1 << output->id;
+
output->global =
wl_display_add_global(c->wl_display, &wl_output_interface,
output, bind_output);
wl_signal_init(&ec->unlock_signal);
ec->launcher_sock = weston_environment_get_fd("WESTON_LAUNCHER_SOCK");
+ ec->output_id_pool = 0;
+
if (!wl_display_add_global(display, &wl_compositor_interface,
ec, compositor_bind))
return -1;
};
struct weston_output {
+ uint32_t id;
+
struct wl_list link;
struct wl_global *global;
struct weston_compositor *compositor;
struct screenshooter *screenshooter;
int launcher_sock;
+
+ uint32_t output_id_pool;
};
#define MODIFIER_CTRL (1 << 8)