diff options
author | emersion <contact@emersion.fr> | 2018-04-05 18:28:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 18:28:16 -0400 |
commit | ce09537a9aefee5fb27de7ec3907cd454e29f1b1 (patch) | |
tree | 29c09ced0a290fffa1664f184aff058a5eb1aa96 | |
parent | 89138e5fb83794ba189bc54bcf759d93ae9b1a47 (diff) | |
parent | ec0ce8ae1c5bb424d3afb694f0ace20112a6575c (diff) |
Merge pull request #840 from swaywm/xdg-output-updates
Fix sending updates to xdg-output resources
-rw-r--r-- | types/wlr_xdg_output.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/types/wlr_xdg_output.c b/types/wlr_xdg_output.c index 91c86b2f..182c5c37 100644 --- a/types/wlr_xdg_output.c +++ b/types/wlr_xdg_output.c @@ -46,6 +46,15 @@ static void xdg_output_manager_get_xdg_output(struct wl_client *client, wlr_output_layout_get(layout, wlr_output); assert(layout_output); + struct wlr_xdg_output *_xdg_output, *xdg_output = NULL; + wl_list_for_each(_xdg_output, &manager->outputs, link) { + if (_xdg_output->layout_output == layout_output) { + xdg_output = _xdg_output; + break; + } + } + assert(xdg_output); + struct wl_resource *output_resource = wl_resource_create(client, &zxdg_output_v1_interface, wl_resource_get_version(resource), id); if (!output_resource) { @@ -55,6 +64,8 @@ static void xdg_output_manager_get_xdg_output(struct wl_client *client, wl_resource_set_implementation(output_resource, &xdg_output_implementation, NULL, NULL); xdg_output_send_details(output_resource, layout_output); + wl_list_insert(&xdg_output->resources, + wl_resource_get_link(output_resource)); } static const struct zxdg_output_manager_v1_interface xdg_output_manager_implementation = { |