diff --git a/libweston/compositor.c b/libweston/compositor.c index 4d87aab31..69ac23627 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -187,6 +187,12 @@ weston_mode_switch_send_events(struct weston_head *head, if (version >= WL_OUTPUT_SCALE_SINCE_VERSION && scale_changed) wl_output_send_scale(resource, output->current_scale); + if (version >= WL_OUTPUT_NAME_SINCE_VERSION) + wl_output_send_name(resource, head->name); + + if (version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION) + wl_output_send_description(resource, head->model); + if (version >= WL_OUTPUT_DONE_SINCE_VERSION) wl_output_send_done(resource); } @@ -5314,6 +5320,12 @@ bind_output(struct wl_client *client, mode->refresh); } + if (version >= WL_OUTPUT_NAME_SINCE_VERSION) + wl_output_send_name(resource, head->name); + + if (version >= WL_OUTPUT_DESCRIPTION_SINCE_VERSION) + wl_output_send_description(resource, head->model); + if (version >= WL_OUTPUT_DONE_SINCE_VERSION) wl_output_send_done(resource); } @@ -5322,7 +5334,7 @@ static void weston_head_add_global(struct weston_head *head) { head->global = wl_global_create(head->compositor->wl_display, - &wl_output_interface, 3, + &wl_output_interface, 4, head, bind_output); } diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c index ca49a04dd..fdfc80979 100644 --- a/tests/weston-test-client-helper.c +++ b/tests/weston-test-client-helper.c @@ -717,6 +717,20 @@ output_handle_scale(void *data, output->scale = scale; } +static void +output_handle_name(void *data, struct wl_output *wl_output, const char *name) +{ + struct output *output = data; + output->name = strdup(name); +} + +static void +output_handle_description(void *data, struct wl_output *wl_output, const char *desc) +{ + struct output *output = data; + output->name = strdup(desc); +} + static void output_handle_done(void *data, struct wl_output *wl_output) @@ -731,6 +745,8 @@ static const struct wl_output_listener output_listener = { output_handle_mode, output_handle_done, output_handle_scale, + output_handle_name, + output_handle_description, }; static void @@ -739,6 +755,8 @@ output_destroy(struct output *output) assert(wl_proxy_get_version((struct wl_proxy *)output->wl_output) >= 3); wl_output_release(output->wl_output); wl_list_remove(&output->link); + free(output->name); + free(output->desc); free(output); } diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h index 34183249d..7cf84d28b 100644 --- a/tests/weston-test-client-helper.h +++ b/tests/weston-test-client-helper.h @@ -163,6 +163,8 @@ struct output { int height; int scale; int initialized; + char *name; + char *desc; }; struct buffer {